Using @RequestParam in Spring MVC

[crayon-5e4d0fc490337318915924-i/] is used to bind the request parameters to Controllers method parameter. [crayon-5e4d0fc490345729846799-i/] has 2 attributes that can be used required and defaultValue. We will see examples of both these attributes. Using @RequestParam in Spring MVC [crayon-5e4d0fc49034b292807455/] In the above code if

Read More

Spring MVC Path Variable Example

In Spring MVC you can use the [crayon-5e4d0fc49106e363719902-i/] 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 Variable [crayon-5e4d0fc491078284766284/] The URI template [crayon-5e4d0fc49107d013390702-i/] specifies the variable

Read More

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 [crayon-5e4d0fc491958507413619-i/] to return an XML representation of an object from the Controller. We will need

Read More

Spring MVC Json Request Example

In the previous post we have seen how we can get the JSON data from the Controllers using the [crayon-5e4d0fc491fd2758637517-i/]. Similarly posting JSON data/objects to the Controllers from views is also easy in Spring MVC. JSON data can be posted to Spring

Read More

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 exchanging and storing data. JSON is all

Read More

Configure Multiple View Resolver in Spring MVC

In some previous posts we have seen various types of View Resolvers in Spring MVC 1. Spring MVC XML View Resolver 2. Spring MVC JSP View Resolver 3. Spring MVC ResourceBundle View Resolver We can also configure these view resolver all together

Read More

Spring MVC ResourceBundle View Resolver

Spring MVC ResourceBundle View Resolver is used to resolve views based on the entries in to a specified properties file. The property file name is to be specified while configuring the [crayon-5e4d0fc493077341241888-i/] bean in the dispatcher servlet. If no property file name

Read More

Spring MVC JSP View Resolver Example

Spring MVC JSP View Resolver is a way to configure the jsp view names using the [crayon-5e4d0fc4935e8084075716-i/]. InternalResourceViewResolver has 2 properties that are very useful 1. prefix 2. suffix. These 2 properties help in determining the complete path of the view. Lets

Read More

Spring MVC XML View Resolver Example

Spring MVC XML View Resolver provides a way to configure the view URL’s in a single XML file. The location of the file is defined in the dispatcher servlet.xml. If we do not define any location in the dispatcher servlet.xml, by default

Read More

Spring MVC Multiple File Upload Example

In the previous post we have seen sample code of Spring MVC File Upload Example. Now in this post we will see the code for Spring MVC multiple File upload. In this we will use a Model class to store a list

Read More