更新时间:2022-04-30 23:19:35
/ j_spring_security_check
URL映射到 UsernamePasswordAuthenticationFilter
以提供服务请求。
/j_spring_security_check
URL is mapped to UsernamePasswordAuthenticationFilter
to serve the requests.
在 UsernamePasswordAuthenticationFilter
中,默认情况下, postOnly
设置为 true
。
In UsernamePasswordAuthenticationFilter
, by default, the postOnly
is set to true
.
中的以下更改spring-security.xml
将 postOnly
设置为 false
工作。
<bean id="authenticationFilter"
class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"
p:postOnly="false" />
此外,在 web.xml
中,需要以下配置:
Also, in web.xml
, the following configuration is required:
<filter-mapping> <filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>