一、質料準備
因爲我這裏是在項目中一步步來研究spring security所以不可能從搭建項目講起了,我只說要用這個spring security框架需要導入哪些基礎的jar
- spring-security-core
- spring-security-web
- spring-security-config
- spring-security-taglibs
這些jar和我都放在我的雲盤裏面,可以放心下載 (http://pan.baidu.com/s/1i4j53zZ)
二、在項目中的web.xml中配置spring security需要的過濾器
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<web:init-param>
<web:param-name>contextConfigLocation</web:param-name>
<web:param-value>classpath:/springmvc-security.xml</web:param-value>
</web:init-param>
</filter>