我正在尝试为登录页面创建注销选项。

  AntPathRequestMatcher pathRequestMatcher = new AntPathRequestMatcher("/logout");
  http.logout().logoutRequestMatcher(pathRequestMatcher);


由于org.springframework.security.web.util.AntPathRequestMatcher.AntPathRequestMatcher在Spring Security 4.1.6中是deprecated,我应该使用哪个类?

最佳答案

AntPathRequestMatcher在Spring 3.x和Spring 4.x之间移动了软件包

Migrating from Spring Security 3.x to 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

关于java - 不推荐使用AntPathRequestMatcher。什么是更换方法?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54125952/

10-11 10:42