1.首先spring security 过滤器在web.xml中的声明位置一定要在action之前,否则不报错,也不拦截action。
2.spring security的filter-mapping 应该是/*
3.一般struts2的filter-mapping 也应该是/*
2.spring security的filter-mapping 应该是/*
3.一般struts2的filter-mapping 也应该是/*
4.如果想使用welcome-file-list,通过jsp跳转,那么需要在struts.properties中配置:struts.action.extension=action,这个配置不会和spring security相关
5. spring security配置中的url需要全部用 ”/”开头
<http auto-config="true" lowercase-comparisons="true">
<form-login login-page="/login.action"
authentication-failure-url="/login.action?error=true"
login-processing-url="/j_security_check"
default-target-url="/edit/fuck.action"
always-use-default-target="true"/>
<intercept-url pattern="/login.action*" filters="none"/>
<intercept-url pattern="/view/**" filters="none"/>
<intercept-url pattern="/" filters="none"/>
<intercept-url pattern="/styles/**" filters="none"/>
<intercept-url pattern="/jquery/**" filters="none"/>
<intercept-url pattern="/images/**" filters="none"/>
<intercept-url pattern="/fckskin/**" filters="none"/>
<intercept-url pattern="/fckeditor/**" filters="none"/>
<intercept-url pattern="/**" access="ROLE_ADMIN"/>
<logout logout-success-url="/login.action"/>
</http>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>