Hi All,
I am using spring mvc with hibernate 3 and orcale 10gR2 for a web based application. In one of my beans I have a date field defined as java.util.date which i format to yyyy/mm/dd using the SimpleDateFormat in the controllers initBinder method.
The problem is I always get the date back with the month being 01. Even if I input 2008/11/12, I get 2008/01/12.Code:protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { String dateFormat = getMessageSourceAccessor().getMessage("format.date", "yyyy/MM/DD"); SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/DD"); //df.setLenient(true); binder.registerCustomEditor(java.util.Date.class, new CustomDateEditor( df, true)); }
I am a little confused of what is going on.
Any input is welcome.
Thank you in advance.


Reply With Quote