1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > SSM遇到的表单问题:The server cannot or will not process the request due to something that is perceived to b

SSM遇到的表单问题:The server cannot or will not process the request due to something that is perceived to b

时间:2021-02-03 01:58:38

相关推荐

SSM遇到的表单问题:The server cannot or will not process the request due to something that is perceived to b

在做SSM项目的时候,遇到下面的错误。经过一步步排查,找到了问题的源头:

在jsp页面有一个用户的birthday属性,在实体类中的类型是Date类型,在进行表单提交的时候,报了400错误

最后,在网上查找资料找到了解决方案:

在实体类User的birthday属性前面加入注解:

如果指定的输入格式是:1997-01-01,则格式如下:

@DateTimeFormat(pattern = "yyyy-MM-dd")

如果指定的输入格式是:1997-01-01 12:12:12,则格式如下:

@DateTimeFormat(pattern = "yyyy-MM-dd")

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。