I want to bind date and time separately in a controller. I have 1 timepicker and 1 datepicker on a form, i use InitBinder binder for time picker which is,
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sdf.setLenient(true);
binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true));
}
But this doesn't work for both time picker and date picker. any better suggestion please....