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...

Spring Batch and MongoDB: cursor-based item reader


Spring Batch is a popular open source batch framework. It integrates with lots of RDBM technologies like JDBC, Hibernate or JPA, but doesn't have official support for NoSQL datastores yet. This post shows how to integrate Spring Batch and MongoDB to read large datasets from this document-oriented datastore.

Lire la suite...

Overview of Spring Data MongoDB


The Spring Data umbrella project aims at providing support for new data access technologies. It hosts many sub-projects and one of them is dedicated to MongoDB. Spring Data MongoDB comes with tons of features for the Java developers working with MongoDB: database and collection management, lightweight object-document mapping, and dynamic repositories are some of these features. Let's take a tour!

Lire la suite...

- page 1 de 5