EnableWebMvc annotation meaning

前端 未结 4 1091
南笙
南笙 2020-12-02 08:34

I read javadoc about @EnableWebMvc.

But I don\'t understand what this annotation mean?

Can you expalin it clearly?

4条回答
  •  青春惊慌失措
    2020-12-02 08:54

    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 is equivalent to 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.

提交回复
热议问题