5

HandlerInterceptorAdapter is deprecated

this is my code

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

public class MyInterceptor extends HandlerInterceptorAdapter{
    
}

screenshot of code

enter image description here

Sandip Gadade
  • 199
  • 1
  • 2
  • 6
  • 1
    From the [docs](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/handler/HandlerInterceptorAdapter.html) of `HandlerInterceptorAdapter` - Deprecated. as of 5.3 in favor of implementing [HandlerInterceptor](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/HandlerInterceptor.html) and/or [AsyncHandlerInterceptor](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/AsyncHandlerInterceptor.html) directly. – Chaosfire Jul 30 '22 at 08:42

1 Answers1

10

The Handler interceptor adapter deprecated because new HandlerInterceptor interface have default methods now. Simple remove HandlerInterceptorAdapter and implements HandlerInterceptor.

George_A
  • 131
  • 4