Demo for spring-security's sudo user like functionality.
Spring-security is a very powerful security module introduced by spring framework and allows a developer to implement authetication and authorization within no time. A very handy feature introduced by spring-security is to let admin user log into an account asa particular user. That is done throught the SwitchUserProcessingFilter. This code demonstrates that feature exactly.
P.S. I have used code from mkyong for building this fast. So I would like to thank him for providing the basic spring-security code. Link for the spring-securoty demo is: http://www.mkyong.com/spring-security/spring-security-form-login-example/