JVM articles

Spring Security configuration

Through our last articles we could discover that Spring Security can be configured in two ways: the first one using standard Spring beans mechanism. The second one is specific for Spring Security because it uses its own XML schema definition (XSD). In this article we'll focus on the second method.

Continue Reading →

Handling of expired sessions in Spring Security

Session consistency is important part which is not overlooked by Spring Security. Thanks to special filter, SessionManagementFilter, the project allows to control better sessions.

Continue Reading →

CSRF protection in Spring Security

Spring Security project provides solutions for a lot of web dangers. One of them is CSRF.

Continue Reading →

Data repositories in Spring Data JPA

Thanks to JPA module of Spring Data project we can simplify database querying. In this article we'll focus on it.

Continue Reading →

Remember me in Spring Security

The article about basic security filter in Spring Security introduces us to particularity of handle remember-me authentication. This time, we'll focus on this aspect more in details.

Continue Reading →

Security filter chain in Spring Security

The first article from this category covers the subject of Spring Security ACL features. But we can still use Spring Security without the roles management. And to do it correctly, we should be familiar with a concept calling security chain.

Continue Reading →

Design patterns in Spring Framework - part 5

Through 4 previous articles, we saw that Spring adopts a big number of creational and structural design patterns. They're not so much behavioral ones and it's why we discover two of them in this article, the last one about design patterns used in Spring.

Continue Reading →

Design patterns in Spring Framework - part 4

This article is the 4th about design patterns used in Spring framework. It'll present new 3 patterns implemented in this framework.

Continue Reading →

View rendering in Spring Web MVC

Spring is compatible with a lot of templating engines as Velocity or Freemaker. It also supports the solutions based on native JSP technology. It's more than interesting to see how it handles these different solutions to generate the views.

Continue Reading →

Primary key strategies in Hibernate

Almost every time we use auto increment keys (or serial in PostgreSQL). But Hibernate allows three more choices to handle primary key generation of entity objects. This article will show it.

Continue Reading →

Design patterns in Spring Framework - part 3

In two previous articles we saw some of design patterns implemented in Spring framework. This time we'll discover 3 new patterns used by this popular framework.

Continue Reading →

Design patterns in Spring Framework - part 2

The last time we talked about design patterns in Spring, we discovered 3 creational and 1 behavioral patterns. This time we'll focus more on structural and behavioral ones.

Continue Reading →

Session crawler valve in Tomcat

When a website is liked by search engine crawlers, it has more chances to be liked (or only known) by real users. However, some server configurations doesn't work well with crawlers activity. And it's the case of Tomcat 7 and its sessions. But one solution exists - crawler session manager valve.

Continue Reading →

Completion service in Java

Producer-consumer services can be very quickly realized with native Java features. One of them, arrived with the 7th version of Java, is CompletionService.

Continue Reading →

Objects locking

Synchronized blocks are only one of methods to handle concurrent access to Java's objects. Another one are the implementation of classes included in java.util.concurrent.locks package.

Continue Reading →

Introduction to Spring Integration

Spring integration is a Spring-family project illustrating well the idea of enterprise integration patterns. To understand better this Spring project, we'll write some test cases to show how they work. This article will introduce the basic concepts of Spring Integration.

Continue Reading →

Design patterns in Spring Framework - part 1

Design patterns help to follow good practices of programming. Spring framework, as one of the most popular web frameworks, also uses some of them.

Continue Reading →

Properties placeholder in Spring Framework

Sometimes you will need to share properties values through multiple configuration files. They can, for example, have the same authentication information about database user, but, they can use different databases. In Spring we can resolve this problem with properties placeholders.

Continue Reading →

Events and listeners in Spring Framework

Events, and generally callback idea, are very popular in technologies associated to GUI (JavaScript, Swing). On the server side of web applications they're less popular. However it doesn't mean that we can't implement one event-oriented architecture on it. Above all when we're working with Spring.

Continue Reading →

Handling annotations with Spring AnnotationUtils

Annotations in Java let us, programmers, to transfer some of configuration from configuration files into Java classes. For example, in Spring, we can configure URL mapping directly inside the controllers thanks to @RequestMapping annotation. But it couldn't be possible without several utilitary classes, like AnnotationUtils, described here.

Continue Reading →