[問題] spring security 問題
大家好,目前有個狀況是
只要一開 spring security, post method 就會進不去...
以下是設定檔跟程式片段
Test.java
...
@RequestMapping(value = { "/test" }, method = RequestMethod.POST)
public void testPost() {
System.out.println("post");
}
@RequestMapping(value = { "/test" }, method = RequestMethod.GET)
public void testGet(HttpServletRequest req) {
System.out.println("get");
}
...
spring-security.xml
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/test" access="permitAll" />
...
</http>
web.xml
<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>
result
同時做了/test的post跟get method, 結果只有出現get...
2015-05-14 WARN PageNotFound:198 - Request method 'POST' not supported
get
...
想請問一下這樣是否有辦法看出哪邊設定出錯?
(如果spring-security.xml的permitAll改成denyAll的話,get會被擋住,
所以設定上應該沒問題才是?)
或者是說有其他的方式可以不要檢查 /test post method?
感謝 <(_ _)>
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.228.38.205
※ 文章網址: https://www.ptt.cc/bbs/java/M.1431572357.A.805.html
※ 編輯: swallowcc (61.228.38.205), 05/14/2015 11:08:42
→
05/14 14:46, , 1F
05/14 14:46, 1F
→
05/14 14:46, , 2F
05/14 14:46, 2F
→
05/14 18:53, , 3F
05/14 18:53, 3F
→
05/14 18:59, , 4F
05/14 18:59, 4F
→
05/14 19:01, , 5F
05/14 19:01, 5F
→
05/14 19:59, , 6F
05/14 19:59, 6F
→
05/14 21:52, , 7F
05/14 21:52, 7F
java 近期熱門文章
PTT數位生活區 即時熱門文章