且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

认证请求/j_spring_security_check 404 错误

更新时间:2022-06-09 00:03:07

看起来您使用的是 Spring Security 4.0 版

It looks like you are using Spring Security version 4.0

我刚刚从 Spring Security 3.2.3 升级到 4.0.1,看起来登录和注销处理程序的默认 URL 已从 /j_spring_security_check 更改为 /login/j_spring_security_logout 分别为 /logout.

I just upgraded from Spring Security 3.2.3 to 4.0.1 and it looks like the default URLs for the login and logout handlers have changed from /j_spring_security_check to /login and /j_spring_security_logout to /logout respectively.

看起来您使用的 URL 缺少路径的应用程序上下文组件部分,这通常是您的 Web 应用程序的名称.它应该看起来更像:

It also looks like the URL you are using is missing the application context component part of the path, which is usually the name of your web application. It should look more like:

http://127.0.0.1:59322/YourWebapp/j_spring_security_check 

或更高的 Spring Security 版本:

or for later Spring Security versions:

http://127.0.0.1:59322/YourWebapp/login