@RequestMapping("/date")
public String date(Date date){
System.out.println(date);
return "hello";
}
@InitBinder
public void initBinder(ServletRequestDataBinder binder){ binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
}
热门评论
请教一下 怎么来访问呢, 我访问的URL是http://localhost:8080/date
输出的是null