EnableWebMvc注释的含义 [英] EnableWebMvc annotation meaning

查看:8573
本文介绍了EnableWebMvc注释的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读 @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配置,<支持href=\"http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/new-in-3.0.html#new-java-configuration\">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 等同于&LT; MVC:注解驱动/&GT; XML格式。它能够为使用 @RequestMapping 来传入请求映射到一定的方法 @Controller -annotated类的支持。你可以阅读有关它配置在默认情况下,如何详细信息自定义的配置<一个href=\"http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-config\">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注释的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆