Sortie de Spring 4.0


Pivotal a annoncé la semaine dernière la sortie de Spring 4.0. Il s'agit du premier changement de version majeure depuis Spring 3.0, en 2009. Cette nouvelle version amène son lot de nouveautés et trace la voie prise par les technologies Spring au sein de la nouvelle structure Pivotal.

Lire la suite...

Documenting a REST API with Swagger and Spring MVC


REST is now the most common way to expose web services. But how to say to clients how to use a REST API? There's no real standard or at least de facto standard to expose a REST contract. Many API resorts to a human-readable documentation, which is manually edited and thus hard to keep perfectly synchronized with the API. Another way is to create the documentation from the code itself, and this is what this article covers, by using Swagger on top of Spring MVC.

Lire la suite...

Using Tomcat JDBC connection pool in a standalone environment


A multi-user application working against a database cannot be efficient if it doesn't use connection pooling. Middleware can offer this service, but not all applications rely on such middleware. These applications must then come up with their own way to pool connections. The Apache Tomcat project doesn't only come with the most popular web container but also with a performant connection pool library, Tomcat JDBC. This post covers how to configure Tomcat JDBC in a typical Maven + Spring application.

Lire la suite...

Introducing the Thymeleaf template engine


There's a bunch of Java template engines, but one of them has been getting some momentum these days: Thymeleaf. Nice and powerful syntax, flexibility, vibrant community, and good integration with popular web technologies, these are all good reasons to discover this alternative to JSP. This article lists the core features of Thymeleaf and shows how to write and process an HTML template.

Lire la suite...

REST Web Services testing with Spring MVC


A previous post introduced the basic features of the Spring MVC test framework. This post covers the testing of a REST web controller: by checking the response status, the content type, and the returned JSON document , we'll verify if the controller behaves as expected.

Lire la suite...

Introducing Spring MVC test framework


Spring MVC comes with a very useful test framework, which allows doing in-depth testing without even starting a web container. If you struggle maintaining any application based on Spring MVC, this post will show you the basics of the Spring MVC test framework.

Lire la suite...

Sortie de Spring 3.2


SpringSource a annoncé la semaine dernière la sortie de la version 3.2 de Spring. Cette nouvelle version consolide les directions prises depuis les versions 3.0 et 3.1, tout en apportant son lot de nouveautés.

Lire la suite...

Work queues with MongoDB and Spring Integration


Work queue is a common pattern to decouple a producer of a request from the actual worker that processes the request. This pattern is especially useful when the producer doesn't expect any response: as the processing is asynchronous, the producer isn't held up and can do something else, instead of waiting for the worker to complete its job.

In this post, we'll see how to quickly implement work queues with MongoDB and Spring Integration.

Lire la suite...

HATEOAS paging with Spring MVC and Spring Data JPA


In a previous post, I exposed the principles of HATEOAS and illustrated these principles with an implementation based on Spring MVC and Spring HATEOAS. In this post, I'll go further with the implementation of a paged REST web services that follows the guidelines of HATEOAS. This implementation is based again on Spring MVC and Spring HATEOAS, and uses Spring Data JPA's built-in paging features for the database backend.

Lire la suite...

HATEOAS with Spring MVC REST


REST has been getting momentum for the last few years. Roy Fielding was the first to come up with the term "REST" in the 5th chapter of his thesis. When describing REST, we usually say this style of architecture builds on top of 5 principles: resources, uniform interface, representation, stateless architecture, hypermedia. Today we'll study the hypermedia principle and see how to implement HATEOAS - hypermedia as the engine of application state - with Spring MVC.

Lire la suite...

- page 1 de 5