java - AntPathRequestMatcher 已弃用。更换方法是什么?
问题描述
我正在尝试为登录页面创建一个注销选项。
AntPathRequestMatcher pathRequestMatcher = new AntPathRequestMatcher("/logout");
http.logout().logoutRequestMatcher(pathRequestMatcher);
由于org.springframework.security.web.util.AntPathRequestMatcher.AntPathRequestMatcher
在deprecated
Spring Security 4.1.6 中,我应该使用哪个类?
解决方案
AntPathRequestMatcher 在 Spring 3.x 和 Spring 4.x 之间移动了包
正如从 Spring Security 3.x 迁移到 4.x所引用的:
RequestMatcher 及其实现已从包
org.springframework.security.web.util
移至org.springframework.security.web.util.matcher
.具体来说
org.springframework.security.web.util.AntPathRequestMatcher
→org.springframework.security.web.util.matcher.AntPathRequestMatcher
推荐阅读
- html - 如何定位具有 position:fixed 的 NAV;在中心?
- excel - Excel VBA 数据抓取 - 并非所有数据都被提取
- list - 如何将元组列表拆分为列表元组?
- c++ - 如何正确删除一行控件并在该位置动态创建一个新控件?
- apache-flink - Apache Flink - 如何在启动时跳过除最近窗口之外的所有窗口
- reactjs - 请求被拒绝,因为 Authorization 标头不包含有效的不记名令牌 (JWT)
- c++ - 使用 Quazip 构建 c++ Qt CLI 工具
- python-3.x - 如何获取具有错误状态的网址
- kubernetes - 无法从 kubernetes 中的另一个 pod ping postgres pod
- alexa-skills-kit - alexa sdk 自定义逻辑来确定是否需要插槽