<mvc:annotation-driven>和<context:annotation-config>

来源:互联网 发布:源码baiboku 编辑:程序博客网 时间:2024/06/08 04:28

<context:annotation-config> declares support for general
annotations such as @Required, @Autowired, @PostConstruct, and so on.

<mvc:annotation-driven /> is actually rather pointless. It
declares explicit support for annotation-driven MVC controllers
(i.e.@RequestMapping, @Controller, etc), even though support for those
is the default behaviour.

My advice is to always declare <context:annotation-config>, but
don’t bother with <mvc:annotation-driven /> unless you want JSON
support via Jackson.

参考链接:https://www.cnblogs.com/dreamroute/p/4493346.html

阅读全文
0 0
原创粉丝点击