| Author |
forward to another action
|
Neeraj Vij
Ranch Hand
Joined: Nov 25, 2003
Posts: 315
|
|
Hi, I have defined an action in struts-config.xml as <action path="/city/introduction" forward="/GDCityDetail.do?methodToCall=displayCityIntroduction"> </action> now I need to forward a request to the above action, in another action. is it possible to do it ? if yes pls. inform. I have tried with the following way.. but it is giving me 404 error. <action path="/GDBrands" type="com.ihg.dec.components.goDiscover.struts.actions.GDHomeDispatchAction" parameter="methodToCall" scope="session"> <forward name="showCityIntroduction" path="/city/introduction"/> <forward name="failure" path="ErrorView"/> </action> Thanks, Neeraj
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
Neeraj, The action you are trying to forward to doesn't have an Action class defined. So why can't you directly forward to DCityDetail.do?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Change <forward name="showCityIntroduction" path="/city/introduction"/> to <forward name="showCityIntroduction" path="/city/introduction.do"/> This seems like kind of a round-about way of doing things, though. Why not just define a global forward? <global-forwards> <forward name="showCityIntroduction" path="/GDCityDetail.do?methodToCall=displayCityIntroduction" /> </global-forwards> You could then use this forward from any action. [ June 26, 2006: Message edited by: Merrill Higginson ]
|
Merrill
Consultant, Sima Solutions
|
 |
Neeraj Vij
Ranch Hand
Joined: Nov 25, 2003
Posts: 315
|
|
Hi, Thanks for yuor inputs. i got it working by using <forward name="showCityIntroduction" path="/city/introduction.do"/> I had an action mapping, which I forgot to paste.. <action path="/GDCityDetail" type="com.ihg.dec.components.goDiscover.struts.actions.GDCityDispatchAction" parameter="methodToCall" name="gdCityContentForm" scope="session"> <forward name="showCityIntroduction" path="GDCityIntroductionView"/> <forward name="showCityHotels" path="GDCityHotelsView"/ </action> Thanks, Neeraj
|
 |
 |
|
|
subject: forward to another action
|
|
|