在接受对象的时候,The request sent by the client was syntactically incorrect.
在接受对象里有个date类,如要date的时候,与springMVC中的机制不相符
在controller类中加入这个。
@InitBinder
public void InitBinder(ServletRequestDataBinder binder){
// 自动转换日期类型的字段格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true));
}
或者在model类中
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date createDate; // 建馆时间