配置了
<mvc:annotation-driven conversion-service="conversionService" />
<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean">
<property name="converters">
<set>
<bean class="com.ixiongyu.controller.converter.StringToDateConverter">
<constructor-arg name="datePattern" value="yyyy-MM-dd"/>
</bean>
</set>
</property>
</bean>
想将字符串转成Date的时候,出现错误:
Failed to convert from type [java.util.ArrayList<?>] totype[java.util.List<org.springframework.core.io.Resource>]
解决方案:
将
<mvc:resources mapping="/js/**" location="/js/"/>
<mvc:resources mapping="/css/**" location="/css/"/>
<mvc:resources mapping="/img/**" location="/img/"/>
改为
<mvc:default-servlet-handler/>
就ok,意思就是没有映射到的URL交给默认的web容器中的servlet进行处理