如题。
<bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg index="0">
<bean class="java.text.SimpleDateFormat">
<constructor-arg><value>yyyy-MM-dd</value></constructor-arg>
</bean>
</constructor-arg>
<constructor-arg index="1"><value>false</value></constructor-arg>
</bean>
</entry>
</map>
</property>
</bean>
<bean id="datetestBean" class="com.huatek.model.DateTestBean">
<property name="date"> <value>1981-01-01</value> </property>
</bean>
博客展示了Spring中关于Date类型的Bean配置代码。定义了CustomEditorConfigurer用于日期格式处理,指定日期格式为yyyy - MM - dd,还配置了datetestBean并设置日期值,体现了Spring在处理日期类型时的配置方式。
536

被折叠的 条评论
为什么被折叠?



