Vita Rara: A Life Uncommon

redirect the usere to where he wants to be

2 Questions:

1. After a successful login I don't want to redirect the user to a hardcodes page (as you do) but i want the user to be redirected where he wanted to go. E.g. if a user clicks on 'sell' he will be forced to log in by the interceptor and after login the sell-page should be shown. If he vlicks on buy the buy-page should be shown after login. Is there an elegant way to do this?

2. Is there i nicer way to access the session? Access the session in an action is very easy (implement SessionAware) and you have a simple map to get and set values. When working with HttpSession i dont't have a map. I'm allways writing a service that just gets a value out of the sessionattributes and does all the casting for me. Now with struts2's actions and interceptors i need to write that service two times. one works with HttpSession, one with map. Am I missing something?

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
  • Allowed HTML tags: <a> <img> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <h1> <h2> <h3>
  • Lines and paragraphs break automatically.
More information about formatting options