<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.
<mvc:annotation-driven>和<context:annotation-config>
最新推荐文章于 2023-03-28 16:34:38 发布