Spring MVC (also called Spring WebMVC) is the Spring Framework module that builds web applications and REST web services on the model-view-controller (MVC) pattern, which splits an application into a model for the data, a view for the output and a controller for the request handling. The module is built around a DispatcherServlet, which receives every incoming request and passes it to the matching request handler method.
Spring MVC framework provides configurable options for URL mappings, view resolvers, error handling, application context, resource resolution, themes and i18n support.
Spring MVC separates the domain model from the web layer. It also works with other Spring modules, such as Spring Security and Spring Data.
1. Getting Started
2. Understanding Basics
- ContextLoaderListener vs DispatcherServlet
- Spring MVC: <context:annotation-config> vs <context:component-scan>
3. Request Mapping and Controllers
- Writing REST Controller with Spring WebMVC
- Spring REST JSON Response Example
- Produce XML Response with Spring WebMVC Controller
- Spring WebMVC HTTP OPTIONS Request Handler
- Spring @RequestMapping Annotation Examples
- Spring MVC Optional @PathVariable in request URI
4. Views and Forms
- Serving JSP with Spring Boot 3
- Spring MVC Populate and Validate Dropdown Example
- Spring MVC XmlViewResolver Configuration Example
- Spring MVC ResourceBundleViewResolver Configuration Example
- Spring MVC InternalResourceViewResolver Configuration Example
- Spring WebMvcConfigurer: Customize Default MVC Configurations
5. Resource Resolution
- Spring MessageSourceAware Java Bean Example
- Spring MVC Internationalization (i18n) and Localization (i10n) Example
- Displaying Images with Thymeleaf and Spring Boot
6. Validation
- Spring Bean Validation – JSR-303 Annotations
- Spring MVC Custom Validator Example
- Spring REST Request Body and Parameter Validation Example
- Spring HandlerInterceptor Example
7. File Download and Upload
- Spring MVC Download File Controller Example
- Spring MVC File Upload with CommonsMultipartResolver
- Spring mvc multiple file upload with progress bar in ajax and jquery
8. Error Handling
- Error Handling with Spring REST
- Spring REST – JSON Response for Access Denied Request
- Spring MVC SimpleMappingExceptionResolver Example
- [Solved] java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.engine.ConfigurationImpl
9. Interview Questions
Happy Learning !!