Spring Security配置好了不起作用

snake_hand發表於2013-03-31

配置了spring security,但是跑起來後,好像沒經過spring security的過濾器。

解決:

spring security的過濾器對映

<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/j_spring_security_check</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

一定要在struts的

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>

過濾器對映的前面

相關文章