Spring MVC PathVariable truncate issue

In earlier posts we have seen How Spring MVC Path Variable work. There is one issue with the @PathVariable. The last @PathVariable in the URL truncates the value passed after the . (dot). In this post we will see the ways to

Read More

Spring MVC Redirect Views Example

In a Spring application you may need to redirect to a view for many reasons 1. On a form submission, a controller will get the POST data to process. If after processing the data we internally forward to request to another Controller,

Read More

Spring MVC @RequestHeader example

Spring MVC has a annotation [crayon-5905c18546957346040211-i/] that can be used to get the details about the HTTP request headers. Lets see some examples or Spring MVC @RequestHeader. Single @RequestHeader @RequestHeader is used with a attribute value to specify the HTTP request header

Read More

Using Themes in Spring MVC

Theme is a collection of static resources, normally style sheets and images, that affect the look and feel of an application. Themes are helpful in enriching user experience. In this post we will see example of Using Themes in Spring MVC application.

Read More

Spring MVC Ajax Handling using JQuery

When working on a web application, we need to deal with many Ajax requests. With the use of JQuery working with AJax (post and gets) in Spring MVC is very easy. Let us see some code samples of Spring MVC Ajax Handling

Read More

Spring MVC view controller Example

View controllers are used to forward a request to the views without any controllers written either using [crayon-5905c18547e88644251465-i/] or [crayon-5905c18547e90777891349-i/] element. Normally in applications view-controllers are used in static cases when there is no Controller Logic (like getting data for dropdowns) to

Read More

Spring MVC Building URIs Example

Spring MVC provides ways to build and encode URI’s from Controller, methods and views. Using [crayon-5905c18548e5c965898046-i/] and [crayon-5905c18548e65218683242-i/] we can create uri. [crayon-5905c18548e6a782083198/] The UriComponents can also be build using individual components like hostName, port, path. [crayon-5905c18548e6f561184947/] Spring MVC Building URI from

Read More

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 Internationalization(i18n) and Localization(L10n). Internationalization is a way of designing software’s

Read More

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 apps, you may end up getting

Read More

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 we can configure these variables in our

Read More