Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AntPathRequestMatcher is deprecated. What is the replacment method?

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?

like image 623
Dil. Avatar asked Sep 10 '25 09:09

Dil.


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


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!