org.springframework.web.method.HandlerMethod 与 org.springframework.messaging.handler.HandlerMethod 转换失败
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 转换失败的更多相关文章
- org.springframework.web.method.ControllerAdviceBean#isApplicableToBeanType 作用
org.springframework.web.method.ControllerAdviceBean#isApplicableToBeanType(@Nullable Class<?> ...
- java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.getEnvironment()Lorg/springframework/core/env/ConfigurableEnvironment;问题
在springsecurity学习中,在加入spring有关的jar包后,出现java.lang.NoSuchMethodError: org.springframework.web.context. ...
- org.springframework.web.struts.ContextLoaderPlugIn 和 org.springframework.web.context.ContextLoaderListener
org.springframework.web.struts.ContextLoaderPlugIn 和 org.springframework.web.context.ContextLoaderLi ...
- 使用ControllerAdvice注意事项,Ambiguous @ExceptionHandler method mapped for [class org.springframework.web.bind.MethodArgumentNotValidException]
前言 ControllerAdvice非常好用,可以把系统内部的异常统一处理.用起来也很简单.比如,http://www.cnblogs.com/woshimrf/p/spring-web-400.h ...
- org.springframework.web.bind.ServletRequestDataBinde
org.springframework.validation Class DataBinder java.lang.Object org.springframework.validation.Data ...
- 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 ...
- org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
异常信息 org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable represen ...
- SpringMVC(四):@RequestMapping结合org.springframework.web.filter.HiddenHttpMethodFilter实现REST请求
1)REST具体表现: --- /account/1 HTTP GET 获取id=1的account --- /account/1 HTTP DELETE 删除id=1的account ...
- org.springframework.web.servlet.PageNotFound
2017-07-11 16:36:13.489 WARN [http-nio-8032-exec-16]org.springframework.web.servlet.PageNotFound -Re ...
随机推荐
- Codeforces Gym100543B 计算几何 凸包 线段树 二分/三分 卡常
原文链接https://www.cnblogs.com/zhouzhendong/p/CF-Gym100543B.html 题目传送门 - CF-Gym100543B 题意 给定一个折线图,对于每一条 ...
- BZOJ2209 [Jsoi2011]括号序列 splay
原文链接http://www.cnblogs.com/zhouzhendong/p/8093556.html 题目传送门 - BZOJ2209 题解 我太弱了,调出这题感觉都要吐了. 题解懒得写了. ...
- asp grid 增加和删除行数据
<table border="0" cellpadding="0" cellspacing="0" style="width ...
- 初识(试)LoadRunner
一.安装和破解 1.傻瓜式安装.[注意:最好不要默认路径安装,因为64位的win7系统安装LR11时,会默认安装到“Program files (x86)”的目录中,该目录名称有空格,会导致录制“We ...
- Apache系列:Centos7.2下安装与配置apache
Centos7.2下安装与配置apache(一) 配置机:腾讯云服务器,centos7.2 一.安装Apache服务(Apache软件安装包叫httpd) yum install httpd -y 二 ...
- .NET Framework 4 与.NET Framework 4 Client Profile有什么区别?
.net framework 自从 2002 年发展至今,已经历了好几个版本,1.0, 1.1, 2.0, 3.0, 3.5 等不同的版本更替,.net framework 的Redistributa ...
- Git 基本命令行操作
一.本地仓库操作 1.初始化 git init 2.添加版本控制文件 git add README.md3.本地提交 git commit -m “1st commit”4.配置远程 ...
- BZOJ2821 作诗(Poetize) 分块
题意 算法 经验总结 代码 题意 不带修改,查询数列[1,n]中[l,r]内的出现正偶数次的数的个数, 数列中的数 <= 1e5, n <= 1e5, 强制在线 算法 查询的内容: 区 ...
- Codeforces.468C.Hack it!(构造)
题目链接 \(dls\)出的比赛诶...这么妙. \(Description\) 令\(f(x)\)表示整数\(x\)在十进制下各个数位的数字之和.给定\(a\),求两个整数\(l,r\),使得\(\ ...
- 51nod 算法马拉松30
题目链接 附一个代码地址 A,这个容斥一下就好了 C,rxd大爷给讲的,首先如果分三种情况(成环,正在比配环,未访问)讨论复杂度是\(3^n * n ^ 2\)的,但是对于每一个环,都可以直接枚举环的 ...