最近關於spring security 不再支持 filters=none 我們有了新的解決辦法方法如下
[java]
<security:http autoconfig=true>
<! loginpage >
<security:formlogin loginpage=/loginjsp/>
<! 對登錄頁面不進行攔截 後面的*主要是請求頁面可能會帶有一些參數>
<security:intercepturl pattern=/loginjsp* filters=none/>
<security:intercepturl pattern=/** access =ROLE_USER/>
</security:http>
<security:http autoconfig=true>
<! loginpage >
<security:formlogin loginpage=/loginjsp/>
<! 對登錄頁面不進行攔截 後面的*主要是請求頁面可能會帶有一些參數>
<security:intercepturl pattern=/loginjsp* filters=none/>
<security:intercepturl pattern=/** access =ROLE_USER/>
</security:http>
[html]
<security:http autoconfig=true>
<! loginpage >
<security:formlogin loginpage=/loginjsp/>
<! 對登錄頁面不進行攔截 後面的*主要是請求頁面可能會帶有一些參數>
<security:intercepturl pattern=/loginjsp* filters=none/>
<security:intercepturl pattern=/** access =ROLE_USER/>
</security:http>
<security:http autoconfig=true>
<! loginpage >
<security:formlogin loginpage=/loginjsp/>
<! 對登錄頁面不進行攔截 後面的*主要是請求頁面可能會帶有一些參數>
<security:intercepturl pattern=/loginjsp* filters=none/>
<security:intercepturl pattern=/** access =ROLE_USER/>
</security:http>
系統報錯如下
orgspringframeworkbeansfactoryparsingBeanDefinitionParsingException: Configuration problem: The use of filters=none is no longer supported Please define a separate <http> element for the pattern you want to exclude and use the attribute security=none
Offending resource: class path resource [applicationContextxml]
後來在網上查資料
不再支持 filters=none 應該改成
[java
<span ><security:* security=none/></span>
<security:http autoconfig=true>
<! loginpage >
<security:formlogin loginpage=/loginjsp/>
<! 對登錄頁面不進行攔截 後面的*主要是請求頁面可能會帶有一些參數>
<security:intercepturl pattern=/** access =ROLE_USER/>
</security:http>
<span ><security:* security=none/></span>
<security:http autoconfig=true>
<! loginpage >
<security:formlogin loginpage=/loginjsp/>
<! 對登錄頁面不進行攔截 後面的*主要是請求頁面可能會帶有一些參數>
<security:intercepturl pattern=/** access =ROLE_USER/>
</security:http>
[java]
<SPAN><security:* security=none/></SPAN>
<security:http autoconfig=true>
<! loginpage >
<security:formlogin loginpage=/loginjsp/>
<! 對登錄頁面不進行攔截 後面的*主要是請求頁面可能會帶有一些參數>
<security:intercepturl pattern=/** access =ROLE_USER/>
</security:http>
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28268.html