• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

forward to another action

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • 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: 39537
778
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Trust God, but always tether your camel... to this tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!