I had declared 2 forwards in the same name. 1 in <action> tag and other in <global-forwards>. But at a certain context can I skip the forward in the <action> tag so that it forwards the page defined in <global-forwards> Is there any way for that?
Hi, When you have the forwards first struts will search in the <action> and if it doesnt find it there then it will look for global forwards. In case you want to have the global forward, then you have to change the name of the forward path in your action, or omit it altogether. <global-forwards> <forward name="searching" path="searching_common.jsp"/> </global-forwards> <action path="/myURL" scope="session" type="myAction"> <forward name="searching_new" path="/searching.jsp"/> </action>[/
Joined: Feb 13, 2007
This is Ok, I know. But I want to know is there any way to skip the forward in <action>
Joined: May 15, 2006
Its simple. Dont use the forward in the action. It will pick from the global-forwards. <global-forwards> <forward name="searching" path="searching_common.jsp"/> </global-forwards>
No, it's not possible. If you define forwards of the same name at both action level and global level, the one at the global level is inaccessible, since Struts will always pick the one at the action level.