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();

}

org.springframework.web.method.HandlerMethod 与 org.springframework.messaging.handler.HandlerMethod 转换失败的更多相关文章

  1. org.springframework.web.method.ControllerAdviceBean#isApplicableToBeanType 作用

    org.springframework.web.method.ControllerAdviceBean#isApplicableToBeanType(@Nullable Class<?> ...

  2. java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.getEnvironment()Lorg/springframework/core/env/ConfigurableEnvironment;问题

    在springsecurity学习中,在加入spring有关的jar包后,出现java.lang.NoSuchMethodError: org.springframework.web.context. ...

  3. org.springframework.web.struts.ContextLoaderPlugIn 和 org.springframework.web.context.ContextLoaderListener

    org.springframework.web.struts.ContextLoaderPlugIn 和 org.springframework.web.context.ContextLoaderLi ...

  4. 使用ControllerAdvice注意事项,Ambiguous @ExceptionHandler method mapped for [class org.springframework.web.bind.MethodArgumentNotValidException]

    前言 ControllerAdvice非常好用,可以把系统内部的异常统一处理.用起来也很简单.比如,http://www.cnblogs.com/woshimrf/p/spring-web-400.h ...

  5. org.springframework.web.bind.ServletRequestDataBinde

    org.springframework.validation Class DataBinder java.lang.Object org.springframework.validation.Data ...

  6. SpringMVC文件上传报错org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart.MultipartHttpServletRequest

    错误信息: java.lang.ClassCastException: org.apache.catalina.connector.RequestFacade cannot be cast to or ...

  7. org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation

    异常信息 org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable represen ...

  8. SpringMVC(四):@RequestMapping结合org.springframework.web.filter.HiddenHttpMethodFilter实现REST请求

    1)REST具体表现: --- /account/1  HTTP GET       获取id=1的account --- /account/1  HTTP DELETE 删除id=1的account ...

  9. org.springframework.web.servlet.PageNotFound

    2017-07-11 16:36:13.489 WARN [http-nio-8032-exec-16]org.springframework.web.servlet.PageNotFound -Re ...

随机推荐

  1. Linux安装Tomcat-Nginx-FastDFS-Redis-Solr-集群——【第九集之安装Tomcat+Nginx反向代理Tomcat集群】

    1,安装Tomcat:和在windows下安装是一样的. 安装tomcat:上传后解压: tar -zxvf apache-tomcat-7.0.88.tar.gz -z:代表.gz格式的压缩包,-x ...

  2. oracle中date数据的转换问题

    (TO_NUMBER(TO_CHAR(FP.KPRQ, 'HH24')) >= 18 kprq >= to_DATE ('2017-01-12 18:00:00','yyyy-MM-dd ...

  3. new Vue 发生了什么

    new Vue 发生了什么 new vue 我们从入口分析,我们new 一个实例化对象,是由Funcction实现的,来看一下源码,在src/core/instance/index.js 中. imp ...

  4. Dev-C++安装第三方库boost

    Dev-C++安装第三方库boost  转 https://www.jianshu.com/p/111571e4d6f5?utm_source=oschina-app 之前鉴于codeblocks界面 ...

  5. angular笔记_8(事件)

    ng-click               鼠标点击 ng-dblclick          鼠标双击 ng-change          value改变 ng-blur             ...

  6. [CQOI2005]三角形面积并

    [CQOI2005]三角形面积并 题目大意: 求\(n(n\le100)\)个三角形的面积并. 思路: 自适应辛普森法,玄学卡精度可过. 源代码: #include<cmath> #inc ...

  7. 获取当前泛型类的传入,BaseDaoImpl<T> implements BaseDao<T>

    public abstract class BaseDaoImpl<T> implements BaseDao<T> { private Class<T> claz ...

  8. Map、Set使用过程中可能出现的问题

    修改了key之后不能remove class Student implements Serializable { Integer id; String name; public Student(Int ...

  9. React性能优化记录(不定期更新)

    React性能优化记录(不定期更新) 1. 使用PureComponent代替Component 在新建组件的时候需要继承Component会用到以下代码 import React,{Componen ...

  10. 设置 IntelliJ IDEA 智能提醒时忽略大小写

    1.Ctrl + Alt + S 打开设置界面(或者从菜单File - settings 进来) 2.在搜索框输入Completion定位到Code Completion功能项 3.在右侧配置界面选中 ...