1 Introduction Asynchronous support introduced in Servlet 3.0 offers the possibility to process an HTTP request in another thread. This is specially interesting when you have a long running task, since while another thread processes this request, the container thread is freed and can continue…
Tag: REST
Exposing HTTP Restful API with Inbound Adapters. Part 2 (Java DSL)
1 Introduction In the previous part of this tutorial, we implemented an application exposing a Restful API using XML configuration. This part will re-implement this application using Spring Integration Java DSL. The application is implemented with Java 8, but when Java 8 specific code is…

Exposing HTTP Restful API with Inbound Adapters. Part 1 (XML)
1 Introduction The purpose of this post is to implement an HTTP Restful API using Spring Integration HTTP inbound adapters. This tutorial is divided into two parts: XML configuration example (this same post). Java DSL example. This will be explained in the next part of…
Migrating Spring MVC RESTful web services to Spring 4
1 Introduction Spring 4 brings several improvements for MVC applications. In this post I will focus on restful web services and try these improvements by performing a migration from Spring MVC 3.2 to Spring 4.0. We will take a project implemented with Spring 3.2 and perform…
Applying aspect oriented programming
1 Introduction This article explains how to apply aspect oriented programming with Spring AOP. The main target of the aspect oriented programming is the separation of cross-cutting concerns. When we talk about cross-cutting concerns we are referring to generic functionality that is used in several…
Handling different subresources with JAX-RS subresource locator
1 Introduction In this article I won’t explain what a resource or sub resource is. There are several pages that explain perfectly well its meaning. For example, you can check Oracle tutorial or Jersey documentation. I will focus on implementing a RESTful service with a…
Centralize validation and exception handling with @ControllerAdvice
1 Introduction The ControllerAdvice annotation introduced by Spring 3.2 allows us to handle several functionalities in a way that can be shared by all controllers (through its handler methods, annotated with @RequestMapping). This annotation is mainly used to define the following methods: @ExceptionHandler: Handles exceptions…
Accessing Restful services. HTTP Message converters
Registered converters When accessing to Restful services, the Spring class RestTemplate maintains a list of message converters. This list will be used to marshal objects into the request body, or unmarshalling them from the response. When instantiating the RestTemplate class, it automatically fills a list…
Create and test REST services with Spring MVC
Introduction The first part of this example shows how to create and test REST services using Spring MVC. The controller contains CRUD operations on warehouses and its products. For this example, the repository is a stub that simulates access to the database. The second part…