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();
Original: https://www.cnblogs.com/tenghoo/p/spring_mvc_Interceptor_handler.html
Author: 青羽
Title: org.springframework.web.method.HandlerMethod 与 org.springframework.messaging.handler.HandlerMethod 转换失败
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/540147/
转载文章受原作者版权保护。转载请注明原作者出处!