码迷,mamicode.com
首页 > 编程语言 > 详细

org.springframework.beans.TypeMismatchException

时间:2015-10-26 13:53:51      阅读:359      评论:0      收藏:0      [点我收藏+]

标签:typemismatchexception

1:BUG详细描述:

在访问 http://localhost:8090/sm/user/showUser 时控制台出现台下错误:

[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapping [/user/showUser] to HandlerExecutionChain with handler [com.ssmm.controller.UserController@55d4ee7e] and 2 interceptors
[org.springframework.web.servlet.DispatcherServlet]Last-Modified value for [/sm/user/showUser] is: -1
[org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver]Resolving exception from handler [com.ssmm.controller.UserController@55d4ee7e]: org.springframework.beans.TypeMismatchException: Failed to convert value of type ‘java.lang.String‘ to required type ‘int‘; nested exception is java.lang.NumberFormatException: For input string: "showUser"
[org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver]Resolving exception from handler [com.ssmm.controller.UserController@55d4ee7e]: org.springframework.beans.TypeMismatchException: Failed to convert value of type ‘java.lang.String‘ to required type ‘int‘; nested exception is java.lang.NumberFormatException: For input string: "showUser"
[org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver]Resolving exception from handler [com.ssmm.controller.UserController@55d4ee7e]: org.springframework.beans.TypeMismatchException: Failed to convert value of type ‘java.lang.String‘ to required type ‘int‘; nested exception is java.lang.NumberFormatException: For input string: "showUser"

2:解决方法:

    1):在showUser方法中的@RequestMapping的标签中添加(value="showUser")后在次访问

org.springframework.beans.TypeMismatchException

标签:typemismatchexception

原文地址:http://cerberus.blog.51cto.com/10688966/1706259

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!