Spring提交表单报莫名其妙的400错误
2017-04-23 00:00
393 查看
关于Spring提交表单报莫名其妙的400错误:
HTTP Status 400 – Bad Request
Type Status Report
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
后台使用了ConversionService:
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;
若表单输入的参数不符合java bean定义的格式就会报400:
eg:
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday;
@NumberFormat(style = NumberFormat.Style.NUMBER, pattern = "#,###")
private int total;
@NumberFormat(style = NumberFormat.Style.PERCENT)
private double discount;
@NumberFormat(style = NumberFormat.Style.CURRENCY)
private double money;
HTTP Status 400 – Bad Request
Type Status Report
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
后台使用了ConversionService:
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;
若表单输入的参数不符合java bean定义的格式就会报400:
eg:
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday;
@NumberFormat(style = NumberFormat.Style.NUMBER, pattern = "#,###")
private int total;
@NumberFormat(style = NumberFormat.Style.PERCENT)
private double discount;
@NumberFormat(style = NumberFormat.Style.CURRENCY)
private double money;
相关文章推荐
- spring表单标签提交返回400错误问题
- springmvc form表单提交报400错误
- 关于form表单提交时报400错误的总结
- 【解决】springmvc 前台表单提交数据返回400错误
- SpringMVC + Spring + MyBatis 学习笔记:提交数据遭遇基础类型和日期类型报400错误解决方法
- 解决YII提交POST表单出现400错误,以及ajax post请求时出现400问题
- SpringMVC + Spring + MyBatis 学习笔记:提交数据遭遇基础类型和日期类型报400错误解决方法
- 表单提交 400错误
- Spring mvc表单提交时出现400错误
- SpringMVC form 表单提交报400错误
- 【已解决】SpringMVC表单提交结果页面出现400错误的可能原因分析
- spring 日期时间提交出现400错误
- SpringBoot页面表单请求失败,错误400的解决办法
- SpringMVC表单提交错误400排查思路及解决方案
- SpringMVC + Spring + MyBatis 学习笔记:提交数据遭遇日期格式转化报400错误解决方法
- yii 2 提交表单报错:Unable to verify your data submission.加入了_csrf也报400错误的解决
- SSM框架中表单提交出现400错误
- spring中表单提交问题 400
- yii2框架中表单提交出现Bad Request (#400)---Unable to verify your data submission的错误解决方
- springmvc form表单提交报400错误,出现400错误的原因及解决方法: