Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts 2.1 Need two different success results  RSS feed

 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9608
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!