This is the code on internet for init binder
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
Can anyone please explain:
1) Why is it used, I mean, what was the problem before , how it was solved with that function. so i want to know what was the problem with orginal date which was solved with this date format?
2) How to use this format from the JSP form point of view, I mean, if we enter date in text format , does it covert to specific format and then save it?
3) How does it apply that formatting , I mean , do we have to do something in object class ?