我正在尝试在 Spring3 中写一些具有安全性的东西。我试图使用默认的登录屏幕,每个人都说 Spring 会为您显示该屏幕。但经过两天的尝试并收到错误:
/spring-security-login not found
我放弃并将代码更改为:
<http auto-config="true">
<intercept-url pattern="/friends/**" access="ROLE_USER,ROLE_ADMIN" />
<form-login login-page="/login.jsp"
default-target-url="/friends/add.html"
authentication-failure-url="/login.jsp?authfailed=true" />
</http>
我将login.jsp
添加到我的项目中,我认为我做得对。现在我收到此错误:
HTTP Status 404 - /MySpring/j_spring_security_check message /MySpring/j_spring_security_check description The requested resource (/MySpring/j_spring_security_check) is not available.
最佳答案
将其添加到您的 web.xml
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
关于spring - j_spring_security_check 不可用。请帮助Spring3登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5450894/