Serve Static Resources with Spring 1. Overview This article explores how to serve static resources with Spring – using both XML and Java configuration. Further reading: Cachable Static Assets with Spring MVC This article shows how to cache your static assets such as Javascript and CSS files when serving them with Spring… Continue Reading spring-mvc-static-resources

Guide to Spring WebUtils and ServletRequestUtils Spring MVC 1. Overview In this quick article, we’ll explore the build-in web request utils in Spring MVC – WebUtils, ServletRequestUtils. *2. WebUtils and ServletRequestUtils * In almost all applications, we face situations where we need to fetch some parameters from an incoming HTTP… Continue Reading spring-webutils-servletrequestutils

REST-assured Support for Spring MockMvc 1. Introduction In this tutorial, we’re going to learn how to test our Spring REST Controllers using RestAssuredMockMvc, a REST-assured API built on top of Spring’s MockMvc. First, we’ll examine the different setup options. Then, we’ll dive into how to write both unit and integration… Continue Reading spring-mock-mvc-rest-assured

HandlerAdapters in Spring MVC 1. Overview In this article, we’ll focus on the various handler adapters implementations available in the Spring framework. 2. What Is a Handleradapter? The HandlerAdapter is basically an interface which facilitates the handling of HTTP requests in a very flexible manner in Spring MVC. It’s used… Continue Reading spring-mvc-handler-adapters

Validating RequestParams and PathVariables in Spring 1. Introduction In this tutorial, we’ll take a look at how to validate HTTP request parameters and path variables in Spring MVC. Specifically, we’ll validate String and Number parameters with JSR 303 annotations. To explore validation of other types, refer to our tutorials about Java Bean Validation and method constraints or… Continue Reading spring-validate-requestparam-pathvariable

Validating Lists in a Spring Controller 1. Introduction Validating user inputs is a common requirement in any application. In this tutorial, we’ll go over ways to validate a List of objects as a parameter to a Spring controller. We’ll add validation in the controller layer to ensure that the user-specified… Continue Reading spring-validate-list-controller