wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts 2.1 Need two different success results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2.1 Need two different success results" Watch "Struts 2.1 Need two different success results" New topic
Author

Struts 2.1 Need two different success results

E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
I have a login page which has an action that logs people in. If the person is a candidate then the result is success and they should be redirected to the candidate folder. If the person is a employer the result is success and they should be redirected to the employer folder.

How do I have 2 different success results go to 2 different locations? I have the candidate folder mapped out but dont know how to map out the success for the employer folder

Here is my action xml

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

You are free to return any String from your action given there is a matching result defined. So you can return "successCandidate" and "successEmployer" for different redirects and define these results in your Struts configuration file...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
Ankit Garg wrote:You are free to return any String from your action given there is a matching result defined. So you can return "successCandidate" and "successEmployer" for different redirects and define these results in your Struts configuration file...


Brilliant thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2.1 Need two different success results