标签:work exce EDA cto orm 配置 ati class drive
//实现类型转换接口 package cn.bdqn.stusystem.util; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import org.springframework.core.convert.converter.Converter; public class DateConverter implements Converter<String, Date>{ @Override public Date convert(String arg0) { SimpleDateFormat sm = new SimpleDateFormat("yyyy-MM-dd"); try { return sm.parse(arg0); } catch (ParseException e) { } return null; } } //在springmvc中配置 <mvc:annotation-driven conversion-service="conversionService"></mvc:annotation-driven> <bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean"> <property name="converters"> <set> <bean class="cn.bdqn.stusystem.util.DateConverter"/> </set> </property> </bean>
标签:work exce EDA cto orm 配置 ati class drive
原文地址:https://www.cnblogs.com/ZhangHaiBK/p/8988710.html