Skip to main content

Redirect to a url after login - Spring Security


If you want the browser to remember the url that you enter before login and redirect to that url after you login to the application. 

  • XML Configuration - spring-security.xml
 

    • What happens after login will be handled by AuthenticationSuccessHandler
    • SavedRequestAwareAuthenticationSuccessHandler will use the saved request stored in the session. After the successfull login the user will be redirected to the original request url.

Comments

Popular posts from this blog

Prototype Design Pattern

Prototype Design Pattern is a creational design pattern which will be used when there is a need to create multiple object with the same class and will be involved in lot of configurations. By using Prototype Design pattern we can clone a existing object with same configurations values, with same property values into a different memory location, that will exclude the costly operations. This will save us both time and resources. When to use? and Why? Creating new objects by cloning other objects. Allows for adding any subclass instance of a known super class at run-time when there are numerous potential classes that you want to only use if needed at run-time. Reduce the need for creating sub classes public interface Shape extends Cloneable {            public Shape makeCopy(); } public class Circle implements Shape {            public Circle() {                 ...