在Springmvc-config添加了如下配置:
<bean id="handlerAdapter" class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="webBindingInitializer"> <bean class="org.fkit.binding.DateBindingInitializer" /> </property> </bean>
但是报错:
ClassNotFoundException: org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
这是因为 org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter已经废弃了
需要使用 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
应该修改为:
<!-- 配置annotation类型的处理器适配器 --> <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> <property name="webBindingInitializer"> <bean class="org.fkit.binding.DateBindingInitializer" /> </property> </bean>