This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2.1 Need two different success results

 
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: 9509
22
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic