问题描述
我读 @EnableWebMvc
的javadoc。
I read javadoc about @EnableWebMvc
.
但我不明白这是什么意思注释?
But I don't understand what this annotation mean?
你能expalin清楚?
Can you expalin it clearly?
推荐答案
当您使用的是Java code(而不是XML)来配置Spring应用程序, @EnableWebMvc
用于启用Spring MVC的。如果你不熟悉Spring的Java配置,this是开始的好地方。
When you're using Java code (as opposed to XML) to configure your Spring application, @EnableWebMvc
is used to enable Spring MVC. If you're not already familiar with Spring's support for Java configuration, this is a good place to start.
@EnableWebMvc
等同于< MVC:注解驱动/>
XML格式。它能够为使用 @RequestMapping
来传入请求映射到一定的方法 @Controller
-annotated类的支持。你可以阅读有关它配置在默认情况下,如何详细信息自定义的配置reference文档。
@EnableWebMvc
is equivalent to <mvc:annotation-driven />
in XML. It enables support for @Controller
-annotated classes that use @RequestMapping
to map incoming requests to a certain method. You can read detailed information about what it configures by default and how to customise the configuration in the reference documentation.
这篇关于EnableWebMvc注释的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!