Archive | Spring RSS feed for this section

How to use RestTemplate with Basic Authentication in Spring

This article shows how to use Springs RestTemplate to consume a RESTful Service secured with Basic Authentication; the article is part of an in depth series on REST with Spring. The REST with Spring series: Part 1 – Bootstrapping a web application with Spring 3.1 and Java based Configuration Part 2 – Building a RESTful [...]

Read full story Comments { 1 }

Project Configuration with Spring

Overview of the problem Being able to set up some configuration that is specific to the environment the application runs on is something that most projects have to solve one way or another. For a Spring application there are several alternatives for addressing this problem, varying from simple and flexible solutions all the way to [...]

Read full story Comments { 10 }

Properties with Spring

Spring has always tried to be as transparent as possible when it comes to working with properties. Before Spring 3.1 however, the mechanism of both adding new sources of properties into Spring as well as actually using the properties wasn’t as flexible and as robust as it could be. Starting with Spring 3.1, the new [...]

Read full story Comments { 4 }

This Is Not Your Father’s Spring – A Learning Project

I started the REST project on github to explore writing an elegant RESTful Web Service with the latest and greatest Spring had to offer. That was the daily SNAPSHOT builds of Spring 3.1, which went GA at the end of last year. Since then, the project has generated a number of posts, on a variety [...]

Read full story Comments { 3 }

Transaction configuration with JPA and Spring 3.1

This is the fifth of a series of articles about Persistence with Spring. This article will focus on the configuration of transactions with Spring 3.1 and JPA. For a step by step introduction about setting up the Spring context using Java based configuration and the basic Maven pom for the project, see this article.

Read full story Comments { 9 }

The Persistence Layer with Spring 3.1 and JPA

This is the third of a series of articles about Persistence with Spring. This article will focus on the configuration and implementation of Spring with JPA. For a step by step introduction about setting up the Spring context using Java based configuration and the basic Maven pom for the project, see this article.

Read full story Comments { 18 }

Simplifying the Data Access Layer with Spring and Java Generics

This is the second of a series of articles about Persistence with Spring. The previous article discussed setting up the persistence layer with Spring 3.1 and Hibernate, without using templates. This article will focus on simplifying the Data Access Layer by using a single, generified DAO, which will result in elegant data access, with no [...]

Read full story Comments { 15 }

The Persistence Layer with Spring 3.1 and Hibernate

This is the first of a series of articles about Persistence with Spring. This article will focus on the configuration and implementation of the persistence layer with Spring 3.1 and Hibernate. For a step by step introduction about setting up the Spring context using Java based configuration and the basic Maven pom for the project, [...]

Read full story Comments { 8 }

Basic and Digest authentication for a RESTful Service with Spring Security 3.1

This is the sixth of a series of articles about setting up a secure RESTful Web Service using Spring 3.1 and Spring Security 3.1. A previous article introduced security in the context of a RESTful service, using form-based authentication. This article will focus on configuration of Basic and Digest authentication and on configuring both protocols [...]

Read full story Comments { 1 }

REST Service Discoverability with Spring

This is the fifth of a series of articles about setting up a secure RESTful Web Service using Spring 3.1 and Spring Security 3.1 with Java based configuration. The previous article introduced the concept of Discoverability for the RESTful service, HATEOAS and followed with some practical scenarios driven by tests. This article will focus on [...]

Read full story Comments { 4 }