解决springmvc出现HTTP Status 400 -description The request sent by the client was syntactically incorrect
操作工具eclipse:
服务器tomcat;
运行项目ssm,在做一个插入操作时报以下错误
HTTP Status 400 -
type Status report
message
description The request sent by the client was syntactically incorrect.
错误分析:意思是springmvc后台接收参数不能进行绑定
经过排查:发现我后台接收参数的封装类的一个属性是Integer类型,而前端页面传过来的值是字符串,所以就会报这种错误。
比如这样:
后端pojo
public class CustomSpace {
private Integer cs_id;
private Integer cstmid;
private Integer ps_id;
private Integer w_id;
}
控制器接收参数:
@RequestMapping("/add")
public String add(HttpServletRequest req,CustomSpace cs) {
return null;
}
前端页面传回来的值:
<tr><td>登记人员</td><td><input name="w_id" value="${sessionScope.user.w_name }"/></td></tr>
还没有评论,来说两句吧...