Hi
Could you please point out why I get the following exception while trying to use CustomEditorConfigurer? Thanks in advance for your time.
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property 'dt'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: No matching editors or conversion strategy found
My configuration file contains the following:
<bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean class="MyDateEditor"></bean>
</entry>
</map>
</property>
</bean>
My property editor is defined below:
public class MyDateEditor extends PropertyEditorSupport
{
private
String dt;
public void setAsText(String text) throws IllegalArgumentException
{
this.dt = text;
Date dtobj= new Date(dt);
setValue(dtobj);
}
}
My Bean class
public class Story
{
private String title;
private String author;
private String content;
private Date dt;
//accessors for other fields go here...
public Date getDt()
{
return dt;
}
public void setDt(Date dt)
{
this.dt = dt;
}
}