类级别的处理器
一:类级别
org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
替换为:
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
二:方法级别
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
替换为:
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
详细配置
<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射,添加拦截器,类级别的处理器映射 -->
<!-- org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" />
<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射,方法级别的处理器映射 -->
<!-- org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
<property name="messageConverters">
<util:list id="beanList">
<!-- for correct download encode -->
<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
<ref bean="mappingJacksonHttpMessageConverter"/>
</util:list>
</property>
</bean>