View controllers are used to forward a request to the views without any controllers written either using ViewControllerRegistry or <mvc:view-controller> element. Normally i
Spring MVC Building URIs Example
Spring MVC provides ways to build and encode URI’s from Controller, methods and views. Using UriComponentsBuilder and UriComponents we can create uri. [cray
Spring MVC Internationalization and Localization
For a web app to be able to used across languages/regions without much of major changes they must support Internationalization and Localization. In this post we will see example of Spring MVC Inter
Spring MVC File Upload Max Size Validation
In one of the earlier posts we have seen Spring MVC File Upload Example. What happens if you have a specific requirement of not allowing users to upload file of over a specified limit? In simple ap
Spring MVC Matrix Variable Example
The URL can have name-value pairs within its path segment. To map these pairs correctly Matrix Variables can be used in Spring MVC. Lets see some of the Spring MVC Matrix Variable Examples and how
Using @RequestParam in Spring MVC
@RequestParam is used to bind the request parameters to Controllers method parameter. @RequestParam has 2 attributes that can be used required and defaultV
Spring MVC Path Variable Example
In Spring MVC you can use the @PathVariable on a method to bind it to the value of a URI template variable. Lets see various Spring MVC Path Variable Example. 1. Simple Path Va
Spring MVC Xml Response Example
In some previous post we saw how we can return Json objects from Spring MVC controllers. Now we will see examples of how we can use the @ResponseBody to return an XML represent
Spring MVC Json Request Example
In the previous post we have seen how we can get the JSON data from the Controllers using the @ResponseBody. Similarly posting JSON data/objects to the Controllers from views i
Spring MVC Json Response Example
JSON objects or Strings can be returned from Spring MVC controllers using some simple steps. Lets see some Spring MVC Json response examples in this post. What is JSON? JSON is a way of easily exch