`
zjnicholas
  • 浏览: 36696 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

一则spring中使用PropertyEditors 来注入日期型属性的技巧

阅读更多
如题。   

<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>  
 

转载自:http://blog.csdn.net/_chage/archive/2005/03/09/315977.aspx
分享到:
评论

相关推荐

    Spring Boot项目中定制PropertyEditors方法

    在本篇文章里小编给大家分享的是一篇关于Spring Boot定制PropertyEditors的知识点内容,有需要的朋友们可以参考学习下。

    Spring中文帮助文档

    6.8.1. 在Spring中使用AspectJ进行domain object的依赖注入 6.8.2. Spring中其他的AspectJ切面 6.8.3. 使用Spring IoC来配置AspectJ的切面 6.8.4. 在Spring应用中使用AspectJ加载时织入(LTW) 6.9. 更多资源 7...

    spring3.0帮助文档(包含REST资料)

    ◆标准化的依赖性注入注释:对Java中依赖性注入的JSR-330标准的完整支持 ◆基于受限注释的声明式模型验证:JSR-303 Bean验证提供的Spring实现。 ◆增强的绑定功能以及注释驱动的格式化:在标准的PropertyEditors...

    spring chm文档

    6.8.1. 在Spring中使用AspectJ来为domain object进行依赖注入 6.8.2. Spring中其他的AspectJ切面 6.8.3. 使用Spring IoC来配置AspectJ的切面 6.8.4. 在Spring应用中使用AspectJ Load-time weaving(LTW) 6.9. ...

    Spring API

    6.8.1. 在Spring中使用AspectJ进行domain object的依赖注入 6.8.2. Spring中其他的AspectJ切面 6.8.3. 使用Spring IoC来配置AspectJ的切面 6.8.4. 在Spring应用中使用AspectJ加载时织入(LTW) 6.9. 更多资源 7...

    Escc.Umbraco.PropertyEditors:Umbraco 7的核心属性编辑器

    Escc.Umbraco.PropertyEditors Umbraco 7的核心属性编辑器。RichTextPropertyEditor 此属性编辑器使用几种方法扩展了内置的RTF编辑器。 自定义Angular控制器运行内置控制器,有效地继承了其默认行为。 Angular指令会...

    Spring.Boot.Cookbook.1785284150

    Over 35 recipes to help you build, test, and run Spring applications using Spring Boot About This Book Learn to create different types of Spring Boot applications, configure behavior, and add custom ...

    asm-3.2.3.jar

    org.springframework.beans org.springframework.beans.annotation org.springframework.beans.factory org.springframework.beans....org.springframework.beans.propertyeditors org.springframework.beans.support

    spring-framework-reference-4.1.2

    3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................

    spring-framework-reference4.1.4

    3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................

    32 数据转换总结及常见面试题目解析慕课专栏(1)1

    引入了FormatterSPI,相比PropertyEditors 简单直接。ConversionService 为 Converter SPI 和 Forma

Global site tag (gtag.js) - Google Analytics