spring中页面传递参数为Date类型自动转换为字符串的方法
@InitBinder
public void initBinder(WebDataBinder binder){
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true));
}
一般定义在Action的抽象父类的方法中。