Spring WebMVC (or Spring MVC) contains Spring’s model-view-controller (MVC) and REST Web Services implementation for web applications. It is designed around a DispatcherServlet that hands over the incoming requests to request handler methods.
Spring MVC framework provides configurable options for URL mappings, view resolvers, error handling, application context, resource resolution, themes and i18n support.
Spring MVC provides a clean separation between the domain model and the web layer. It also integrates seamlessly with other Spring modules such as Spring security and Spring Data for additional functionalities.
1. Getting Started
- Spring MVC Hello World Example
- Spring MVC Hello World Example with Maven and JSTL
- Spring REST CRUD Example with JPA Configuration
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
- Spring MVC JSTL Configuration Example
- Spring MVC Populate and Validate Dropdown Example
- Spring MVC XmlViewResolver Configuration Example
- Spring MVC ResourceBundleViewResolver Configuration Example
- Spring MVC InternalResourceViewResolver Configuration Example
5. Resource Resolution
- Spring MessageSourceAware Java Bean Example
- Spring MVC Internationalization (i18n) and Localization (i10n) Example
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 !!