POST 400 Bad Request The request sent by the client was syntactically incorrect
2014-07-21 13:53
489 查看
最近在做Web开发的时候,使用$.post提交数据,但是回调函数却没有被触发,按F12看控制台输出是:POST *** 400 Bad Request
后台是SpringMVC的,设置了断点也不会被触发。
后来查看JQuery资料了解到,$.post提交数据只有成功时才触发回调函数,于是改用$.ajax提交数据,添加error回调函数,得到错误信息了,如下图:
这个问题是什么原因造成的呢?
后来经过测试发现,是表单提交的内容数据类型与实体的(也就是数据表字段)的数据类型不匹配导致的。
在提交表单之前应该对用户输入的内容做验证,后台直接做映射了,没有做内容验证的机会。
后台是SpringMVC的,设置了断点也不会被触发。
后来查看JQuery资料了解到,$.post提交数据只有成功时才触发回调函数,于是改用$.ajax提交数据,添加error回调函数,得到错误信息了,如下图:
这个问题是什么原因造成的呢?
后来经过测试发现,是表单提交的内容数据类型与实体的(也就是数据表字段)的数据类型不匹配导致的。
在提交表单之前应该对用户输入的内容做验证,后台直接做映射了,没有做内容验证的机会。
相关文章推荐
- 转:POST 400 Bad Request The request sent by the client was syntactically incorrect
- 解决 spring mvc3.1下post json出现HTTP Status 400 The request sent by the client was syntactically incorrect
- HTTP 400: Bad Request The request sent by the client was syntactically incorrect
- 解决 spring mvc3.1下post json出现HTTP Status 400 The request sent by the client was syntactically incorrect
- 400 Bad Request The request sent by the client was syntactically incorrect ().
- http 400 Bad Request The request sent by the client was syntactically incorrect
- SpringMVC---400错误The request sent by the client was syntactically incorrect ()
- SpringMVC 表单提交参数不匹配报错 提交表单报400错:description The request sent by the client was syntactically incorrect.
- spring mvc 数据绑定问题 提交表单提示HTTP status 400, The request sent by the client was syntactically incorrect
- 前端到后端------HTTP Status 400 ( The request sent by the client was syntactically incorrect)
- spring mvc 400,The request sent by the client was syntactically incorrect的问题
- javaweb项目错误400-The request sent by the client was syntactically incorrect.
- Http 400 --- The request sent by the client was syntactically incorrect
- springMVC报出400,The request sent by the client was syntactically incorrect.
- The request sent by the client was syntactically incorrect. 400 问题
- HTTP Status 400 - description The request sent by the client was syntactically incorrect.
- 错误400 The request sent by the client was syntactically incorrect ()的解决
- 错误400-The request sent by the client was syntactically incorrect
- http 400错误 描述:The request sent by the client was syntactically incorrect
- SpringMVC---400错误The request sent by the client was syntactically incorrect ()