aspose file tools
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


Win a copy of Elasticsearch in Action this week in the Big Data forum!
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: 9327
    
  19

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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts 2.1 Need two different success results