Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Navigating with form actions in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Navigating with form actions in Struts" Watch "Navigating with form actions in Struts" New topic
Author

Navigating with form actions in Struts

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Hi,
If I have a form action defined in my struts-config.xml as shown below as "/login", I assume that struts performs the login action class, which returns a "success" or a "failure". Is there anyway that I can take that success value and then perform another action? I tried as below but this does not work. Basically, what I want to happen, is if the LoginAction returns success, I want PreMainAction to be executed. Any tips of where I am wrong in my logic?



Thanks, Kim

[ November 15, 2004: Message edited by: Kim Kantola ]
[ November 15, 2004: Message edited by: Kim Kantola ]
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
You'll need to pretend that you're the browser calling the action and include the servlet-mapping.

ie:<forward name="success" path="/preMain.do"/>
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Thank you Thank you!
I was going to make a hole in my cube wall from banging my head into it so many times from the frustration!
I just tried this out and it worked exactly as I hoped it would.
I so appreciate your time.
Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Navigating with form actions in Struts
 
Similar Threads
My Execute method does not called
Cannot load a validator resource
When is the class that extends ActionForm executed
problems with action mapping
action mapping for pre-login