This is the internet code 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 someone explain please:
1) Why this is used, I mean, what was the problem before, how it was solved using this function. so I want to know what was the problem with the original date that was resolved with this date format?
2) How to use this format in terms of the JSP form, I mean, if we enter the date in text format, it is converted to a specific format and then saves it?
3) How is this formatting applied, I mean, do I need to do something in the object class?
java spring-mvc binding
John Mar 06 2018-11-11T00: 00Z
source share