码上敲享录 > Spring框架常见问题详解分享 > springmvc对象接收参数Failed to load resource: the server responded with a status of 400 (Bad Request)

springmvc对象接收参数Failed to load resource: the server responded with a status of 400 (Bad Request)

上一章章节目录下一章 2018-05-16已有2854人阅读 评论(0)

springmvc使用对象接收页面传过来的参数时候,报错信息如下所示:

Failed to load resource: the server responded with a status of 400 (Bad Request)


解决方法:

如果一个参数是时间,而你的hibernate实体的对应的属性类型是Date类型,使用Date类型接收时间字符串就会报错,请求无法到达方法。在Date属性的get方法上面添加一下注解即可

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

@Column(name = "update_time")

public Date getUpdateTime() {

return updateTime;

}


本文地址:http://www.yayihouse.com/yayishuwu/chapter/1243


向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交