I'm new comer on swf. I try to use custom property editor but not success yet.
I have a entity BorrowingBook with two field have a Date property. I try to use propertyEditorRegistrar in my flow config look like this :
And this is my PropertyEditors implementation :Code:<bean id="borrowBookAction" class="org.springframework.webflow.action.FormAction"> <property name="formObjectClass" value="org.kris.entity.BorrowingRecord"/> <property name="propertyEditorRegistrar" value="org.test.util.PropertyEditors"/> </bean>
This class entity :Code:public class PropertyEditors implements PropertyEditorRegistrar{ public void registerCustomEditors(PropertyEditorRegistry registry) { SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-mm-dd"); dateFormat.setLenient(false); registry.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); } }
but if i try to run this code i getting error look like this :Code:@Entity public class BorrowingRecord implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String isbn; @Temporal(javax.persistence.TemporalType.DATE) private Date borrowDate; @Temporal(javax.persistence.TemporalType.DATE) private Date returnDate; private String reader;
I don't know how to use it with proper value with my entity class property. How to use property editor for spesific value ?Code:Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.beans.PropertyEditorRegistrar] for property 'propertyEditorRegistrar': no matching editors or conversion strategy found
Is there another way to use it ?
Thanks lot before...


Reply With Quote