问题:使用 Spring Security 自带的退出功能时,点击"/logout"链接后,浏览器报错"There was an unexpected error (type=Not Found, status=404).",Idea 控制台中显示"o.s.web.servlet.PageNotFound : No mapping for GET /logout"。
原因:从 Spring Security 3.2 开始,默认启用了 CSRF 防护。在启用了 CSRF 防护的 Spring 程序中退出用户,必须发起 POST 请求。