Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to forward to Action class

Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a jsp which makes request to an Action class Action1.

Action1 get all request parameters, say form parameters , updates the database and then it should forward the control to another Action Action2 or an jsp.

The forward to jsp is working fine.

but for the forward to Action2 gives an error, resource with path /action2 is not available.

my mapping is
return mapping.findForward("action2");

my struts-config.xml is

< action path="/action1" type="Action1" name="myForm">
< forward name="myjsp1" path="/myjsp1" /> --> no problem here..

< forward name="action2" path="/action2" /> --> here i have problem..
< /action>

< action path="/action2" type="Action2" name="myForm" >
< forward name="something" path="something" />
< /action>
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the following line

< forward name="action2" path="/action2" />


< forward name="action2" path="/" />

Remember, this is a URL so it has to have the ".do" suffix.

This link explains more about action chaining.
    Bookmark Topic Watch Topic
  • New Topic