本人博客已移至: www.andyqian.com 此处不再更新.........
本人在使用spring mvc 中遇到的常见的错误以及出现原因如下:
错误一 如图(1) 所示:
http Status 400 The request sent by the client was syntactically incorrect
图(1)
出现原因有:
① model与(输入)View 类型不匹配, 例如在Model 中定义的是 int ,而在(输入)View 中传入的是字符串或者其他
不匹配
类型,
错误二: 如图(2) 所示:
The resoure identified by this request is only capable of generating responses with characeristics
not acceptable accoding to the rquest "accept" hearders
图(2)
出现原因: ①
在spring-servlet.xml 文件中 缺少 <mvc:annotation-driven/>
② 请求controller header(浏览器或者程序)中的accpet与controller中的不匹配
出现以上错误的原因有很多,正在持续更新中.....