Springmvc

hander.getclass
class org.springframework.web.method.HandlerMethod

HandlerMethod.class
class org.springframework.messaging.handler.HandlerMethod

执行以下转换,报异常。

HandlerMethod method = (HandlerMethod) handler;

让 Interceptor 继承 HandlerInterceptorAdapter,不要继承HandlerInterceptor,即可解决。

if(HandlerMethod.class.equals(handler.getClass())){
HandlerMethod method = (HandlerMethod) handler;
Object controller = method.getBean();


}

相关文章:

  • 2021-04-16
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2022-01-11
  • 2021-08-06
  • 2021-11-10
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-03-02
  • 2022-02-10
  • 2021-07-02
相关资源
相似解决方案