Spring MVC "The request sent by the client was syntactically incorrect ()"解决办法
来源:互联网 发布:淘宝女士丝巾 编辑:程序博客网 时间:2024/05/01 14:57
使用Spring MVC3框架时,可能会遇到这个问题,请求后台没有任何响应,页面显示
The request sent by the client was syntactically incorrect 说的意思是:由客户端发送的请求是语法上是不正确的
把spring日志级别调整到debug级别(log4j.logger.org.springframework=DEBUG),终于找出原因了:
Field error in object 'ad' on field 'beginDate': rejected value [2015-6-24 15:50:14]; codes [typeMismatch.ad.beginDate,typeMismatch.beginDate,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [ad.beginDate,beginDate]; arguments []; default message [beginDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'beginDate'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type @javax.persistence.Column java.util.Date for value '2015-6-24 15:50:14'; nested exception is java.lang.IllegalArgumentException]
说是日期转换错误,bean里用的是date类型,jsp用的input,string类型
解决办法:在bean的getBeginDate方法上加注解:
如果传入的值是yyyy-MM-dd HH:ss:mm类型的,就加@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
如果传入的值是yyyy-MM-dd类型的,就加@DateTimeFormat即可
之前解决过,这次又遇到忘记了,写下来作为记录。
- Spring MVC "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 ()"解决办法
- Spring MVC "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 ()"解决办法
- Spring MVC "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 ()"解决办法
- 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 - Spring mvc
- 异常处理Spring MVC "The request sent by the client was syntactically incorrect ()"
- Spring MVC报错:The request sent by the client was syntactically incorrect ()
- spring mvc 400,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 ()的解决
- Java屏幕截图
- vi命令应用
- Java作业整理
- 自定义返回按钮
- Struts2+Hibernate4+Spring3 整合登录例子
- Spring MVC "The request sent by the client was syntactically incorrect ()"解决办法
- ztree点击事件加载树
- 百度地图主动定位功能
- swift 的关健词
- IOS8 旋转的问题
- 学习ASP.NET MVC5框架揭秘笔记-ASP.NET MVC路由(五)
- OpenWrt配置opkg.conf
- 谈科目三考试
- iOS中使用.plist文件延迟读取的方法