Jquery dispatcher.xml中不推荐使用DefaultAnnotationHandlerMapping
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter已被弃用,并且 mvc-dispatcher.xml中的org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping错误。为什么会这样? 请帮帮我 代码如下所示Jquery dispatcher.xml中不推荐使用DefaultAnnotationHandlerMapping,jquery,json,spring,mapping,dispatcher,Jquery,Json,Spring,Mapping,Dispatcher,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter已被弃用,并且 mvc-dispatcher.xml中的org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping错误。为什么会这样? 请帮帮我 代码如下所示 <bean class="org.springframework.web.serv
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="saveGeoJSON.html">HspatialController</prop>
</props>
</property>
</bean>
空间控制器
DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter是删除的如果使用Spring 3.1及更高版本,则应将这些类替换为
RequestMappingHandlerMapping
和RequestMappingHandlerAdapter
如果您选中,您将看到这些类被弃用的原因:
Spring3.1引入了一组新的处理支持类
带注释控制器的请求:
RequestMappingHandlerMapping
请求映射HandlerAdapter
异常句柄异常解析器
这些类别取代了现有的:
DefaultAnnotationHandlerMapping
注释方法HandlerAdapter
AnnotationMethodHandlerExceptionResolver
新的类是根据许多请求开发的
annotation controller支持更可自定义和开放的类
分机。而以前,您可以配置自定义注释
控制器方法参数解析器,具有您需要的新支持类
可以自定义任何受支持的方法参数或
返回值类型
第二个显著的区别是引入了handler方法
表示@RequestMapping方法的抽象。这个抽象
始终由新的支持类作为处理程序实例使用。
例如,HandlerInterceptor可以将处理程序从对象强制转换为对象
HandlerMethod和获取访问目标控制器的方法,其
注释等
默认情况下,MVC命名空间和
通过@EnableWebMvc进行基于Java的配置。现有的课程将
继续可用,但建议使用新类
继续前进
如果您使用的是Spring 3.1及更高版本,则应将这些类替换为
RequestMappingHandlerMapping
和RequestMappingHandlerAdapter
如果您选中,您将看到这些类被弃用的原因:
Spring3.1引入了一组新的处理支持类
带注释控制器的请求:
RequestMappingHandlerMapping
请求映射HandlerAdapter
异常句柄异常解析器
这些类别取代了现有的:
DefaultAnnotationHandlerMapping
注释方法HandlerAdapter
AnnotationMethodHandlerExceptionResolver
新的类是根据许多请求开发的
annotation controller支持更可自定义和开放的类
分机。而以前,您可以配置自定义注释
控制器方法参数解析器,具有您需要的新支持类
可以自定义任何受支持的方法参数或
返回值类型
第二个显著的区别是引入了handler方法
表示@RequestMapping方法的抽象。这个抽象
始终由新的支持类作为处理程序实例使用。
例如,HandlerInterceptor可以将处理程序从对象强制转换为对象
HandlerMethod和获取访问目标控制器的方法,其
注释等
默认情况下,MVC命名空间和
通过@EnableWebMvc进行基于Java的配置。现有的课程将
继续可用,但建议使用新类
继续前进
我的代码更改如下org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping但仍然是406错误您能帮我解决这个问题吗?错误406意味着由请求标识的资源只能生成响应实体根据请求中发送的accept标头,具有不可接受的内容特征。控制器中的Accept是否有标头限制?您可以发布控制器的代码吗?请单击我的代码更改如下org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping,但仍然存在406错误。您可以帮助我解决此问题吗?错误406表示请求标识的资源已被删除仅能够根据请求中发送的accept标头生成具有不可接受内容特征的响应实体。控制器中的Accept是否有标头限制?您可以发布控制器的代码吗?请单击