springmvc 请求出现400错误

一般都是表单数据没有对应造成

还有一种情况是日期没有处理,需要在Controller中加入如下代码

@InitBinder
 protected void initBinder(HttpServletRequest request,
   ServletRequestDataBinder binder) throws Exception {
  binder.registerCustomEditor(Date.class, new DatePropertyEditor(yourDateformat));
 }

你可能感兴趣的:(springmvc 请求出现400错误)