@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的抽象父类的方法中。
@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的抽象父类的方法中。
转载于:https://www.cnblogs.com/liuye-micky/p/7011729.html