This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes navigation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "navigation problem" Watch "navigation problem" New topic

navigation problem

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
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.

have a great day,
krishna prasad
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: navigation problem
Similar Threads
problem paging HTML table
html:image - running into an infinite loop
does session remain alive even if i shuts down the server in tomcat?
Where to populate values for drop down box?
Getting confuse on Struts action call when I click back button