WebMvcConfigurerAdapter vs WebMvcConfigurationSupport in Spring MVC

In this tutorial, we will discuss about difference between webmvcconfigureradapter vs webmvcconfigurationsupport. These both classes are related to Spring MVC java based configuration. It is actually simplified web configuration with Spring in the web application. Let's see some differences between of these two classes.

Popular Tutorials

WebMvcConfigurerAdapter vs WebMvcConfigurationCupport

WebMvcConfigurationSupport WebMvcConfigurerAdapter
In the Spring MVC framework, this is the main class providing the configuration behind the MVC Java config. This is simple adapter class for customizing some of the default configuration.
We could use the @EnableWebMvc annotation to import the configuration of this class automatically. This is not related to the @EnableWebMvc annotation.
We could extend WebMvcConfigurationSupport class to prevent the default configuration imported by the @EnableWebMvc annotation. We could extend WebMvcConfigurerAdapter class to customize some of the default configuration imported by @EnableWebMvc annotation.
In the java configuration file for spring mvc either we could use @EnableWebMvc annotation or extend WebMvcConfigurationSupport class. If we are extending this class, still required to use @EnableWebMvc annotation, otherwise application will not work.


Spring MVC Related Posts
  1. Spring MVC Web Tutorial
  2. Spring MVC Interview Questions
  3. MVC Design Pattern
  4. Spring MVC DispatcherServlet
  5. Spring MVC WebApplicationContext and Root Application Context
  6. Spring MVC @Controller Annotation
  7. Spring MVC @RequestMapping Annotation
  8. Spring MVC @RequestParam Annotation
  9. Spring MVC ContextLoaderListener
  10. Spring MVC @RequestParam and @PathVariable annotations
  11. Spring MVC Hello World Example
  12. Spring MVC Exception Handling Example
  13. Spring MVC with Hibernate CRUD Example
  14. Spring MVC Tiles Plugin with Example
  15. Spring MVC Interceptor with example
  16. Spring MVC with MongoDB CRUD Example
  17. Spring MVC Internationalization & Localization with Example


Labels: , ,