Skip to content

Instantly share code, notes, and snippets.

@benelog
Created April 18, 2012 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benelog/2410547 to your computer and use it in GitHub Desktop.
Save benelog/2410547 to your computer and use it in GitHub Desktop.
Spring value parsing
<bean id="dateEditor" class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyy/MM/dd HH:mm:ss" />
</bean>
</constructor-arg>
<constructor-arg value="true" />
</bean>
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<ref local="dateEditor" />
</entry>
</map>
</property>
</bean>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment