In my web application, i am using struts2 and freemarker. Locale setting is in French ("dd/MM/yyyy").
In my freemarker template, i defined jQuery ui datepicker in an input element with name attribute that points to my object’s date attribute.
The Problem is that, on form submit, SOMETIMES i’m getting ognl warning saying "type conversion error - Cannot set String into the Date object.". In response i can see message cannot finc input results in my action. It’s quite strange because the problem occurs sometimes, sometimes not…
In my page, i have a list of products, with inputs and names like product[1].startDate, product[2].startDate, etc which are linked in my action by a List.
I tried setting locale into the struts.properties to French and this quite helps, but still in 10% of the time i can see this problem.
Can anyone tell me how to map a datepicker to a Date object without ognl converting it to a string?
I think the problem could be due to
StringtoDateconversion. Check two of my previous posts, here and here for conversion details. You can also check the javadoc of StrutsTypeConverter and DefaultTypeConverter.