It was a bit odd...but I had a several break points set in the controller so that I would be sure that I would get a break somewhere. But it never stopped on any of the break points. I finally stopped the tc server and closed STS down, and restarted it up. Now I can hit the break points without any issue.
I'm using Spring Roo 1.1.5 which uses Spring MVC 3. I'm not using Webflow. In the controller (which was generated by Roo) there is a method that is as follows:
Code:
void addDateTimeFormatPatterns(Model uiModel) {
uiModel.addAttribute("client_dateofbirth_date_format", DateTimeFormat.patternForStyle("M-", LocaleContextHolder.getLocale()));
}
When this is executed I get the following error:
Code:
org.springframework.validation.BindingResult.client=org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'client' on field 'dateOfBirth': rejected value [2011-06-24]; codes [typeMismatch.client.dateOfBirth,typeMismatch.dateOfBirth,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [client.dateOfBirth,dateOfBirth]; arguments []; default message [dateOfBirth]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'dateOfBirth'; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "2011-06-24"]
I have dateOfBirth defined this way in my entity:
Code:
@Temporal(TemporalType.DATE)
@DateTimeFormat(style="M-")
private Date dateOfBirth;
I've tried setting the dateformatter using @InitBinder without any success. Any suggestions?
Thanks,
John