[ 
http://issues.apache.org/struts/browse/STR-2864?page=comments#action_38040 ] 
            
Ted Husted commented on STR-2864:
---------------------------------

> To employ uniqueness checking of an actionId, I added to
> ModuleConfigImpl.addActionConfig. That method currently overwrites any
> action configs that are duplicate -- the last one is the winner. Should
> I take the same approach for duplicate ids? Or should I throw an
> exception on duplication? I'd like some guidance here because I don't
> know which makes more sense; I tend towards throwing an error (duplicate
> ids smell), but history allows the last one win.

Whatever we do, it should be consistent with what is done with other 
configuration elements. If the actionid throws an exception, then the path 
should throw an exception too. 

-Ted.

> Add actionId attribute to action mapping
> ----------------------------------------
>
>                 Key: STR-2864
>                 URL: http://issues.apache.org/struts/browse/STR-2864
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Core
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Paul Benedict
>         Assigned To: Paul Benedict
>             Fix For: 1.3.6
>
>         Attachments: patch.txt, patch.txt, STR-2864.patch.txt, 
> struts-config.xml
>
>
> Many times I need to redirect to another Struts actions. Recently I've come
> across the problem of needing to rename my action paths but this became a real
> nightmare to keep the action names as well as my redirect (forward) paths in
> synchronization.
> I propose adding an id attribute to the <action> tag so that it can be 
> referred
> to in <forward> tags and its URL would be inferred, rather than be explicitly
> listed out. I find this proposal also to work well as a replacement for global
> forwards.
> <action id="viewJournal" path="/journal/view" ...>
>  ...
> </action>
> <action id="saveJournal" path="/journal/save" ...>
>   <forward name="success" path="id:viewJournal" redirect="true" />
> </action>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to