import org.springframework.web.bind.annotation.InitBinder;
/**
* 日期格式化器
* @param binder
*/
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
解决springmvc参数中带有日期格式数据导致的404问题