AntPathRequestMatcher is deprecated. What is the replacment method?

Viewed 1139

I'm trying to create a logout option for login page.

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

Since org.springframework.security.web.util.AntPathRequestMatcher.AntPathRequestMatcher is deprecated in Spring Security 4.1.6, which class I supposed to use?

1 Answers

The AntPathRequestMatcher has moved packages between Spring 3.x and Spring 4.x

As quoted from Migrating from Spring Security 3.x to 4.x:

The RequestMatcher and its implementations have moved from the package org.springframework.security.web.util to org.springframework.security.web.util.matcher.

Specifically

org.springframework.security.web.util.AntPathRequestMatcherorg.springframework.security.web.util.matcher.AntPathRequestMatcher

Related