Spring4 customEditors

Spring4.0版本以后customEditors属性为Map<Class<?>, Class<? extends PropertyEditor>>,所以用key(对应要编辑的属性类别,即要编辑类的全称,含包名)、value(该类对应的属性编辑器bean)在applicationcontext.xml中进行配置

<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
	<property name="customEditors">
		<map>
			<entry key="Chapter5.Car" value="Chapter5.CustomCarEditor">
			</entry>
		</map>
	</property>
</bean>

  

posted @ 2016-06-17 19:14  SaraMorning  阅读(312)  评论(0编辑  收藏  举报