Please follow the below steps:
- Add the spring.jar into your project
In the web.xml file, add the following piece of code
<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/acegi-security-config.xml </param-value> </context-param> <!-- Spring Security Filter --> <filter> <filter-name>Acegi Filter Chain Proxy</filter-name> <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class> <init-param> <param-name>targetClass</param-name> <param-value>org.acegisecurity.util.FilterChainProxy</param-value> </init-param> </filter> <filter-mapping> <filter-name>Acegi Filter Chain Proxy</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>AuthenticatedFilter</filter-name> <filter-class>com.security.AuthenticatedFilter</filter-class> </filter> <filter-mapping> <filter-name>AuthenticatedFilter</filter-name> <servlet-name>action</servlet-name> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
acegi-security-config.xml, is the spring security configuration file