Returning Plain HTML From a Spring MVC Controller
1. Overview In this tutorial, we want to have a look at how to return HTML from a Spring MVC controller. Let's take a look at what needs to be done. 2. Maven Dependency First, we have to add the...
View ArticleAdd BigDecimals using the Stream API
1. Overview We usually use the Java Stream API for processing collections of data. One nice feature is support for operations on numeric streams, like the sum operation. However, we cannot process all...
View ArticleIntro to Coroutines with Quasar
1. Introduction Coroutines are an alternative to Java Threads as they provide a way to execute interruptable tasks on a very high level of concurrency, but until Project Loom is complete, we have to...
View ArticleHelpful NullPointerExceptions in Java 14
1. Overview In this tutorial, we'll continue our series on Java 14 by taking a look at Helpful NullPointerExceptions, which is a new feature introduced with this version of the JDK. 2. Traditional...
View ArticleIntroduction to Guava Throwables
1. Overview In this article, we're going to take a quick look at Google Guava's Throwables class. This class contains a set of static utility methods for dealing with exception handling and:...
View ArticleCollection Transformations in Kotlin
1. Introduction We often need to work with collections in our Kotlin code, and on many occasions, we need to be able to transform either the elements of the collection or the entire collection into...
View ArticleConditional Flow in Spring Batch
1. Introduction We use Spring Batch to compose jobs from multiple steps that read, transform, and write data. If the steps in a job have multiple paths, similar to using an if statement in our code, we...
View ArticleUsing Guava’s MapMaker
1. Introduction MapMaker is a builder class in Guava that makes it easy to create thread-safe maps. Java already supports WeakHashMap to use Weak References for the keys. But, there is no...
View ArticleChecksums in Java
1. Overview In this mini-article, we'll provide a brief explanation of what checksums are and show how to use some of Java's built-in features for calculating checksums. 2. Checksums and Common...
View ArticleGuide to the Number Class in Java
1. Overview In this tutorial, we'll discuss Java's Number class. First, we'll learn what the Number class does and what methods it contains. Then, we'll dive into the various implementations of this...
View ArticleJava Thread Deadlock and Livelock
1. Overview While multi-threading helps in improving an application's performance, it also comes with some problems. In this tutorial, we'll look into two such problems, deadlock and livelock, with the...
View ArticleQuick Guide to Spring Cloud Circuit Breaker
1. Overview In this tutorial, we'll introduce the Spring Cloud Circuit Breaker project and learn how we can make use of it. First, we're going to see what the Spring Cloud Circuit Breaker offers in...
View ArticleJava Weekly, Issue 328
1. Spring and Java >> Getting Started With RSocket: Spring Boot Channels [spring.io] A quick intro to bi-directional data streaming with RSocket channels. >> Java's Missing Features: 5...
View ArticleSpring MVC Data and Thymeleaf
1. Introduction In this tutorial, we'll talk about different ways to access Spring MVC data using Thymeleaf. We'll start by creating an email template using Thymeleaf, and we'll enhance it with data...
View ArticleSpring Configuration Bootstrap vs Application Properties
1. Overview Spring Boot is an opinionated framework. Despite this, we usually end up overriding autoconfigured properties in an application configuration file such as application.properties. However,...
View ArticleHTTP/2 in Netty
1. Overview Netty is an NIO-based client-server framework that gives Java developers the power to operate on the network layers. Using this framework, developers can build their own implementation of...
View ArticleJava Map With Case-Insensitive Keys
1. Overview Map is one of the most common data structures in Java, and String is one of the most common types for a map's key. By default, a map of this sort has case-sensitive keys. In this short...
View ArticleCustom Naming Convention with Spring Data JPA
1. Introduction Spring Data JPA offers many features to use JPA in an application. Among those features, there's the standardization of table and column names in both DDL and DML queries. In this short...
View ArticleIntroduction to Terraform
1. Overview Infrastructure-as-Code (IaC) is a practice that has become mainstream with the growing popularity of public cloud providers, such as AWS, Google, and Microsoft. In a nutshell, it consists...
View ArticleBSON to JSON Document Conversion in Java
1. Overview In this previous article, we've seen how to retrieve BSON documents as Java objects from MongoDB. This is a very common way to develop a REST API, as we may want to modify these objects...
View Article