会自动注册DefaultAnnotationHandlerMappingAnnotationMethodHandlerAdapter两个bean,是spring MVC为@Controllers分发请求所必须的。并提供了:数据绑定支持,@NumberFormatannotation支持,@DateTimeFormat支持,@Valid支持,读写XML的支持(JAXB),读写JSON的支持(Jackson)。


declares support for general annotations such as @Required,@Autowired, @PostConstruct, and so on.


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 , but don't bother with unless you want JSON support via Jackson.

你可能感兴趣的:()