JVM articles

CountDownLatch in Java

Java's version 1.5 introduced more of features to help to deal with multi-threading programs. One of these features is a class which allows a main thread to wait another threads before continue. The name of this class is CountDownLatch.

Continue Reading β†’

Locking in Hibernate JPA

Locking is very useful for the applications based on concurrency. Thanks to it, we can avoid the collision being a results from simultaneous updates to the same data by two or more different users.

Continue Reading β†’

Difference between SessionFactory and EntityManagerFactory

There are two ways to handle persistence in Hibernate: session and entity manager. Through this article, we'll see the differences between this two mechanisms.

Continue Reading β†’

Forms and validation in Play Framework

When user can't interact with the application, he loses the interest for it. It's why forms and other input methods are a useful to satisfy the final user demand. Play Framework also supports operations on forms, as generation from POJO or dynamic validation with annotations.

Continue Reading β†’

Sessions in Play Framework

In our's Play application, user can navigate on the site, add several products to his shopping cart and, at the end, terminate his shopping. As in all "classical" web applications, in Play this persistence is possible thanks to sessions.

Continue Reading β†’

Instruction try-with-resources

Java 7 was released on July 28, 2011. But they're still the places where we don't use all features of this version (because of installed 6 version or no budget to make the migration). One of these Java 7 elements which can improve code readability is, try-with-resources instruction.

Continue Reading β†’

Bean scopes in Spring

Spring beans, like the ones from JavaBeans, use the scopes. We've already seen two of them, singleton and prototype. It's the right time to discover 3 new scopes.

Continue Reading β†’

HTTP parameters and routes in Play Framework

E-commerce store with static URLs would kill even the most powerful server. It's why, to resolve dynamic behavior, we use HTTP parameters. GET ones are particularly useful.

Continue Reading β†’

Database and JPA in Play Framework

The next step in Play Framework discovery is the work with database data. Thanks to it, we can use centralized and dynamically managed data.

Continue Reading β†’

Introduction to Play Framework

When we build webapps, we can think that all of them can be constructed with Spring framework and its related projects. It's right, but which programmer is satisfied by knowing only one framework or only one programming language ? It's why we'll explore here another way to deploying web applications, the deploying with Play Framework.

Continue Reading β†’

Google Guava : primitives support

Another interesting feature of Google Guava is Java's primitves support which allows us to work easiest with booleans, ints, longs or even bytes, signed as well as unsigned.

Continue Reading β†’

Autowired annotation in Spring

Have you ever asked you about @Autowired annotation in Spring ? Frequently used to facilitate Dependency Injection, an whole mechanism is hidden under this process.

Continue Reading β†’

@ModelAttribute in Spring

Previously we approached the idea of Spring validation with annotations. We mentioned several lines about @ModelAttribute annotations. But it's still not sufficient to understand well this concept.

Continue Reading β†’

Spring validation with @Valid

Validation features in Spring are universal. You can use annotation or make your own validator and bind it into the request. This article will focus on the first solution.

Continue Reading β†’

Handler interceptors in Spring

Standard way of catching HTTP request in Java's web applications is the use of filters. But they are reserved only for webapps. Spring introduces a new way to do it, more general, called handler interceptors.

Continue Reading β†’

Handlers in Spring

Central piece of Spring web application is DispatcherServlet. It's a central point of entry for all incoming requests. But it can't do nothing without another important concept, handlers.

Continue Reading β†’

Spring DispatcherServlet lifecycle

The master piece of Spring web framework architecture is dispatcher servlet. We'll focus on it in this article.

Continue Reading β†’

Introduction to Spring Security

Using Spring Security is like the blessing. Everything is coded and you only need to implement it correctly. But always is good to know what we are implementing. This is the main purpose of this article, to understand how one of particular Spring Security modes, ACL, works.

Continue Reading β†’

Introduction to Google Guava

External libraries are always helpful. They can help to resolve many "hot" programming problems, but also learn us the good rules of coding. One of this type of libraries in Java world is Google Guava.

Continue Reading β†’

String memory management in Java

One of the most used objects in Java is String. This omnipresence makes that String is managed a little bit differently than other objects in Java.

Continue Reading β†’