Quadreg
May 4th, 2008, 09:19 AM
Hi all,
I'm using a simple login approach in a web application.
When the user's session isn't validated, we redirect him to a login page.
For example:
return new ModelAndView(new RedirectView("login.htm"));
This works fine, but after the user logs in on login.htm he gets forwared to the main page.
Is there a way to find out from where the user was redirected ? So we can redirect the user to his original request.
I know it's possible to just store the source of the redirect somewhere and then retrieve this location after logging in.
But I was wondering if there was a more elegant approach to this.
I'm using a simple login approach in a web application.
When the user's session isn't validated, we redirect him to a login page.
For example:
return new ModelAndView(new RedirectView("login.htm"));
This works fine, but after the user logs in on login.htm he gets forwared to the main page.
Is there a way to find out from where the user was redirected ? So we can redirect the user to his original request.
I know it's possible to just store the source of the redirect somewhere and then retrieve this location after logging in.
But I was wondering if there was a more elegant approach to this.