struts和spring security整合时注意点
新手发文章,不对地方请见谅
今天看了Spring security,想整合到struts中,一直通不过,网上有很多配置spring security文章的,我就不多说了, ,我要说的注意点:在web.xml时,一定要将spring security的mapping写在struts的前面,保证spring securit在链的前面,希望刚学的人少走弯路.
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filterclass>
org.springframework.web.filter.DelegatingFilterProxy\
</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filterclass> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>