- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter 已弃用并且mvc-dispatcher.xml 中的 org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping 错误。为什么会这样?请帮助我?
代码如下
<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
。
如果您检查 Spring 3.1 reference documentation ,您会明白为什么这些类已被弃用:
Spring 3.1 introduces a new set of support classes for processing requests with annotated controllers:
RequestMappingHandlerMapping
RequestMappingHandlerAdapter
ExceptionHandlerExceptionResolver
These classes are a replacement for the existing:
DefaultAnnotationHandlerMapping
AnnotationMethodHandlerAdapter
AnnotationMethodHandlerExceptionResolver
The new classes were developed in response to many requests to make annotation controller support classes more customizable and open for extension. Whereas previously you could configure a custom annotated controller method argument resolver, with the new support classes you can customize the processing for any supported method argument or return value type.
A second notable difference is the introduction of a HandlerMethod abstraction to represent an @RequestMapping method. This abstraction is used throughout by the new support classes as the handler instance. For example a HandlerInterceptor can cast the handler from Object to HandlerMethod and get access to the target controller method, its annotations, etc.
The new classes are enabled by default by the MVC namespace and by Java-based configuration via @EnableWebMvc. The existing classes will continue to be available but use of the new classes is recommended going forward.
关于jquery - Dispatcher.xml 中已弃用 DefaultAnnotationHandlerMapping,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31902767/
我对 DefaultAnnotationHandlerMapping 的工作方式感到困惑。 在我的 web.xml 我有 spring /somePath/someWork
在 Spring MVC 中,类 DefaultAnnotationHandlerMapping 已弃用。文档(http://docs.spring.io/spring/docs/current/ja
我一直按照指示 here 进行操作使用注释和重写 DefaultAnnotationHandlerMapping 来实现 spring mvc 处理程序拦截器。 但是,我的拦截器从未被调用。 有人能看
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter 已弃用并且mvc-dispatcher.xm
我将 Spring MVC 与 结合使用 我已经实现了我自己的扩展 DefaultAnnotationHandlerMapping 的映射处理程序,但我不确定如何使用它。我已经这样声明了: 它可以
我开始从基于 XML 的配置转向 @EnableWebMvc 和 WebMvcConfigurerAdapter 配置。但是当我更改配置时,它似乎从 DefaultAnnotationHandlerM
当我使用 DispatcherServlet 时,我得到一个 java.lang.IllegalStateException: No WebApplicationContext found: no C
如何关闭 org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping detectorHandlers
我正在使用 Spring MVC 开发 Web 应用程序。在尝试添加 Spring Security 之后,我开始开发 Web 应用程序;但我收到此消息,但找不到解决方案。 16-04-2010 12
问题: 我正在为执行类中的方法创建一个切入点。该类是一个 Controller 类,由注解@Controller 表示,因此方面所需的相同不需要bean。我附上了dispathcher servlet
我是一名优秀的程序员,十分优秀!