• 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

navigation problem

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have series of pages connected by 'back' and 'next' buttons. i have problems in navigating through pages.

on clicking the 'next' or 'back' button of a jsp, it's Action is called, and in the action, depending upon the button pressed, i set the forward.

Forward mapping
"success" - jsp of that action.
"back" - previous page's Action class.
"next" - next page's Action class.

simple code logic
if(no button of that action is pressed)
set forward as "succcess"
else if('next' is pressed)
set forward as "next"
else if('back' is pressed)
set forward as "back"

What should happen

1. clicked next button on a jsp page
2. it's action is called
3. forward is set as "next".
4. The Action for the next page is called
5. it's forward is set as "success"
6. jsp of next page is called

what actually happens

1. clicked next button on a jsp page.
2. it's action, Action1 is called.
3. forward is set as "next".
4. The action for the next page, Action2 is called.
5. forward is set as "success".
6. Action1 is called.
7. forward is set as "success"
8. the same page is displayed, instead of next page.

"success" is mapped to a jsp page in struts-config.xml. But even after setting the forward to "success", how in the world an Action file (*.do) is called. I have debugged the code in jboss eclipse, and i tracked the series of events. Even RequestProcessor's 'name' is set as "success" and 'path' has been set to a jsp file, but how the Action file being called is...i couldn't figure out.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic