Working with Select and Option in Thymeleaf
1. Overview Thymeleaf is the very popular templating engine bundled together with Spring Boot. We’ve already published a number of articles about it, and we highly recommend going over the Baeldung’s...
View ArticleA Guide to DeltaSpike Data Module
1. Overview Apache DeltaSpike is a project which provides a collection of CDI extensions for Java projects; it requires a CDI implementation to be available at runtime. Of course, it can work with the...
View ArticleJava EE Servlet Exception Handling
1. Introduction In this tutorial, we’re going to handle exceptions in a Java EE Servlet application – in order to provide a graceful and expected outcome whenever an error happens. 2. Java EE Servlet...
View ArticlePractical Java Examples of the Big O Notation
1. Overview In this tutorial, we’ll talk about what Big O Notation means. We’ll go through a few examples to investigate its effect on the running time of your code. 2. The Intuition of Big O Notation...
View ArticleOptimistic Locking in JPA
1. Introduction When it comes to enterprise applications, it’s crucial to manage concurrent access to a database properly. This means we should be able to handle multiple transactions in an effective...
View ArticleJava System.getProperty vs System.getenv
1. Introduction The package java.lang is automatically imported when in a Java application. This package contains many commonly used classes from NullPointerException to Object, Math, and String. The...
View ArticleGet and Post Lists of Objects with RestTemplate
1. Introduction The RestTemplate class is the central tool for performing client-side HTTP operations in Spring. It provides several utility methods for building HTTP requests and handling responses....
View ArticleJava Weekly, Issue 234
Here we go… 1. Spring and Java >> Monitor and troubleshoot Java applications and services with Datadog Optimize performance with end-to-end tracing and out-of-the-box support for popular Java...
View ArticleDocker Test Containers in Java Tests
1. Introduction In this tutorial, we’ll be looking at Java TestContainers library. It allows us to use Docker containers within our tests. As a result, we can write self-contained integration tests...
View ArticleIntroduction to Joda-Time
1. Introduction Joda-Time is the most widely used date and time processing library, before the release of Java 8. Its purpose was to offer an intuitive API for processing date and time and also...
View ArticleIntroduction to JavaPoet
1. Overview In this tutorial, we’ll explore the basic functionalities of the JavaPoet library. JavaPoet is developed by Square, which provides APIs to generate Java source code. It can generate...
View ArticleImmutable Objects in Java
1. Overview In this tutorial, we’ll learn what makes an object immutable, how to achieve immutability in Java, and what advantages come with doing so. 2. What’s an Immutable Object? An immutable...
View ArticleJava 8 Unsigned Arithmetic Support
1. Overview From the dawn of Java, all numerical data types are signed. In many situations, however, it’s required to use unsigned values. For example, if we count the number of occurrences of an...
View ArticleHow to Get the File Extension of a File in Java
1. Overview In this quick tutorial, we’ll show how to obtain the file extension programmatically in Java. We’ll focus on three major approaches to the problem. In our implementations, the characters...
View ArticleConvert a String to Title Case
1. Introduction In this short tutorial, we’ll show how to convert a String to title case format in Java. We’ll show different ways of implementing a custom method and we’ll also show how to do it...
View ArticleAn Introduction to CDI (Contexts and Dependency Injection) in Java
1. Overview CDI (Contexts and Dependency Injection) is a standard dependency injection framework included in Java EE 6 and higher. It allows us to manage the lifecycle of stateful components via...
View ArticleJava with ANTLR
1. Overview In this tutorial, we’ll do a quick overview of the ANTLR parser generator and show some real-world applications. 2. ANTLR ANTLR (ANother Tool for Language Recognition) is a tool for...
View ArticleGet Date Without Time in Java
1. Introduction In this short tutorial, we’ll show how to get a Date without time in Java. We’ll show how to do this before and after Java 8 since things have become a bit different after the release...
View ArticleTesting Callbacks with Mockito
1. Overview In this short tutorial, we’ll focus on how to test Callbacks using the popular testing framework Mockito. We’ll explore two solutions, firstly using an ArgumentCaptor and then the...
View ArticleKotlin String Templates
1. Overview In this tutorial, we’ll explain what Kotlin’s String templates are and how to use them. In order to get familiar with other features and to know how to use Kotlin, have a look at one of...
View Article