Welcome to the world of Spring. You need to understand before you know what the @EnableWebMVC annotation @EnableWebMVC .
Spring traditionally supports two types of configurations:
These annotations are essentially implemented as part of MVC Java Config Design .
Consider a simple class:
@EnableWebMvc @Configuration public class WebConfig { }
There are no base classes. No spring beans in sight .. Hmmm ..
Let's look a little further:
- What does this really provide?
Well, to bore you a little, it provides a lot of things like:
and a few more.
Ahaha ... But your application works with it correctly. So where is the magic ...?
@EnableWebMVC <---- What behind this..?
This is behind her:
@Retention(RetentionPolicy.RUNTIME) @Import(DelegatingWebMvcConfiguration.class) @Target(ElementType.TYPE) public @interface EnableWebMvc { }
Look, now you would think how pointless to use @EnableWebMVC . Would you prefer:
You can read:
Hope this helps. :)
user2339071 10 Oct '13 at 11:10 2013-10-10 11:10
source share