简体   繁体   中英

Spring Security filter, HTTP Status 405 - Request method 'POST' not supported

I have done my RESTful Webservice along with the same project that implements Admin panel application. The problem i face is that the POST request comes to the application gets converted to GET.

<servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<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> 

When the filter got commented everything works as normal.

Other GET requests are having no problem in both case when filter is present or not.

error i get is

HTTP Status 405 - Request method 'POST' not supported

How can i override Spring security filter for my Web service ?

solved

Just un-comment any resource if you don't want authentication to be done on them

@ spring security.xml file add the following.

<http pattern="/webservice/**" security="none"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM