aspose file tools*
The moose likes Struts and the fly likes Duplicate action and path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Duplicate action and path" Watch "Duplicate action and path" New topic
Author

Duplicate action and path

kiran kumar
Greenhorn

Joined: Apr 04, 2006
Posts: 27
Hello,

I was given a web appliation where i have to extend the functionalit. i have a struts configuration file which has got duplicate path elements.
i dont understand what could be need to have duplicate paths offcourse one is forwarding direclty to the jsp where as other has got a correspding action. I would appreciate if any one can clear me this doubt.
Here is an example of what i was trying to say
<action path="/selectHierarchy" forward="/jspHierarchySelection.jsp" />
<action path="/selectHierarchy" type="HierarchySelectionAction" name="dynaHierarchySelectionForm" validate="false">
<forward name="success" path="/jsp/reporting-mso/HierarchySelection.jsp" />
</action>
srilatha kareddy
Ranch Hand

Joined: Jan 12, 2006
Posts: 32
use

<global-forwards>
<forward name="" path=""/>
</global-forwards>
kiran kumar
Greenhorn

Joined: Apr 04, 2006
Posts: 27
Hello Srilatha,
Thanks for your response.
May be i was not clear with the question.My question is
"which action is being processed when a request arrives", there are two actions which services the same path.which path is processed by the request processor. Hope i am clear this time.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Duplicate action paths are not supported. Struts will use one and ignore the other, but I'm not sure which will be used and which ignored.

My guess is that the previous developer decided to change the mapping, but forgot to remove the old one.
[ April 04, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
kiran kumar
Greenhorn

Joined: Apr 04, 2006
Posts: 27
Merrill Higginson , i appreciate your response.
It is not the case with a single action which i can think of as an unintentional, almost it is the case with 50% of the action mappings.
srilatha kareddy
Ranch Hand

Joined: Jan 12, 2006
Posts: 32
i made a little search and found this... hope this may help you

if you define duplicate action-mapping (by
path) or form-beans (by name), the last one is loaded silently.
kiran kumar
Greenhorn

Joined: Apr 04, 2006
Posts: 27
Thanks Srilatha for your interest in answering my question.
what would be the need to have duplicate actions if the later is processed.I am trying to find out that.because the earlier developer made the duplicate actions deliberately.
kiran kumar
Greenhorn

Joined: Apr 04, 2006
Posts: 27
Thanks Srilatha for your interest in answering my question.
what would be the need to have duplicate actions if the later is processed.I am trying to find out that.because the earlier developer made the duplicate actions deliberately.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Duplicate action and path