一.SpringMVC运行原理
二.SpringMVC 对 Date 类型转换
<mvc:annotation-driven conversion-service="conversionService"></mvc:annotation-driven>
<bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
<property name="registerDefaultFormatters" value="false" />
<property name="formatters">
<set>
<bean class="org.springframework.format.number.NumberFormatAnnotationFormatterFactory" />
</set>
</property>
<property name="formatterRegistrars">
<set>
<bean class="org.springframework.format.datetime.joda.JodaTimeFormatterRegistrar">
<property name="dateFormatter">
<bean class="org.springframework.format.datetime.joda.DateTimeFormatterFactoryBean">
<property name="pattern" value="yyyy-MM-dd" />
</bean>
</property>
</bean>
</set>
</property>
</bean>
@RequestMapping("demo")
public String demo(@DateTimeFormat(pattern="yyyy-MM-dd") Date time){
System.out.println(time);
return "abc.jsp";
}