I know this question has been asked before, however I\'m facing a particular issue here.
I use spring security 3.1.3.
I have 3 possible login cases in my web
The following generic solution can be used with regular login, a Spring Social login, or most other Spring Security filters.
In your Spring MVC controller, when loading the product page, save the path to the product page in the session if user has not been logged in. In XML config, set the default target url. For example:
In your Spring MVC controller, the redirect method should read out the path from the session and return redirect:.
So, after user logs in, they'll be sent to /redirect page, which will promptly redirect them back to the product page that they last visited.