• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

forward to another action

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic