Reading HttpServletRequest Multiple Times in Spring 1. Introduction In this tutorial, we’ll learn how to read the body from the HttpServletRequest multiple times using Spring. HttpServletRequest is an interface which exposes getInputStream()  method to read the body. By default, the data from this InputStream can be read only once. 2. Maven… Continue Reading spring-reading-httpservletrequest-multiple-times

Spring MVC Streaming and SSE Request Processing 1. Introduction This simple tutorial demonstrates the use of several asynchronous and streaming objects in Spring MVC 5.x.x. Specifically, we’ll review three key classes: ResponseBodyEmitter SseEmitter StreamingResponseBody Also, we’ll discuss how to interact with them using a JavaScript client. 2. ResponseBodyEmitter ResponseBodyEmitter handles async responses. Also, it represents… Continue Reading spring-mvc-sse-streams

Returning Image/Media Data with Spring MVC 1. Overview In this tutorial, we’ll illustrate how to return images and other media using the Spring MVC framework. We will discuss several approaches, starting from directly manipulating HttpServletResponse than moving to approaches that benefit from Message Conversion, Content Negotiation and Spring’s Resource abstraction.… Continue Reading spring-mvc-image-media-data

Interface Driven Controllers in Spring 1. Introduction In this tutorial, we consider a new feature of Spring MVC that allows us to specify the web requests using usual Java interfaces. 2. Overview Usually, when defining a controller in Spring MVC, we decorate its methods with various annotations that specify the… Continue Reading spring-interface-driven-controllers

Apache Tiles Integration with Spring MVC 1. Overview Apache Tiles is a free, open source templating framework purely built on the Composite design pattern. A Composite design pattern is a type of structural pattern which composes objects into tree structures to represent whole-part hierarchies and this pattern treats individual objects… Continue Reading spring-mvc-apache-tiles

Overview and Need for DelegatingFilterProxy in Spring 1. Overview The DelegatingFilterProxy is a servlet filter that allows passing control to Filter classes that have access to the Spring application context. Spring Security relies on this technique heavily. In this tutorial, we’ll cover it in detail. 2. DelegatingFilterProxy The Javadoc for DelegatingFilterProxy states that… Continue Reading spring-delegating-filter-proxy