SpringMVC报错The request sent by the client was syntactically incorrect ()
来源:互联网 发布:apache shiro 教程 编辑:程序博客网 时间:2024/06/08 05:25
http://luanxiyuan.iteye.com/blog/1876029
springmvc数据绑定是一个很好的东西,在数据绑定的时候一定要主意Controller方法中的参数名和jsp页面里的参数名字是否一致或者按照绑定的规范来写,如果不一致,可能回报如下错误:
The request sent by the client was syntactically incorrect ().从字面上理解是:客户端发送的请求语法错误。实际就是springmvc无法实现数据绑定。
随便举个例子说明:
- public String saveOrder(
- String[] itemIds,
- @RequestParam("level")String[] levels,
- ModelMap modelMap)
这里面的itemIds就一定要和jsp页面里的参数名字相同;如果你非要命名不相同要像levels的写法那样通过@RequestParam来转换,其中括号里面的level是jsp页面里面的参数名字,levels是在controller方法中要用到的名字;如果jsp页面中没有itemIds和level任何一个参数,也会报相同的错误,就是因为springmvc无法实现数据的绑定。因此,如果不能保证存在”level”的参数,必须使用:@RequestParam(value = "level", required = false)
==================================================================================================
表单提交的字段中有值为空,后台实体类对应的属性为int型,所以springmvc没有匹配到对应值,改为包装类型就OK了。
0 0
- SpringMVC报错The request sent by the client was syntactically incorrect () or 400
- SpringMVC报错The request sent by the client was syntactically incorrect ()
- SpringMVC form提交报错The request sent by the client was syntactically incorrect
- SpringMVC报错The request sent by the client was syntactically incorrect ()
- SpringMVC报错The request sent by the client was syntactically incorrect ()
- SpringMVC报错The request sent by the client was syntactically incorrect ()
- springmvc报错:The request sent by the client was syntactically incorrect
- Spring MVC报错:The request sent by the client was syntactically incorrect ()
- Spring MVC报错:The request sent by the client was syntactically incorrect ()
- The request sent by the client was syntactically incorrect.
- The request sent by the client was syntactically incorrect.
- The request sent by the client was syntactically incorrect问题解决
- The request sent by the client was syntactically incorrect
- The request sent by the client was syntactically incorrect ()问题
- The request sent by the client was syntactically incorrect.
- The request sent by the client was syntactically incorrect
- The request sent by the client was syntactically incorrect.
- The request sent by the client was syntactically incorrect ()"解决办法
- 数据结构——20 单链表逆序
- Python学习之路1 有序集合和无需集合
- SpringMVC Controller层接收表单提交的数据时,发生Sring转换为Date异常
- 进程管理(一)程序
- 多线程之再探
- SpringMVC报错The request sent by the client was syntactically incorrect ()
- C++网络框架和库
- PAT 1059. Prime Factors (25)(分解质因数)
- Drop、Truncate和Delete的区别
- UE4安卓打包出错-Substance原因
- 设计模式——模板方法模式
- c/c++字符串分割方法总结2
- 【最大流】ECNA 2015 F Transportation Delegation (Codeforces GYM 100825)
- 【技术分享】CVE-2016-4656:苹果Pegasus漏洞技术分析详解