How to Access an Iteration Counter in a For Each Loop
1. Overview While iterating over data in Java, we may wish to access both the current item and its position in the data source. This is very easy to achieve in a classic for loop, where the position is...
View ArticleJava Weekly, Issue 361
1. Spring and Java >> Announcing GraalVM 20.3 [medium.com] Improved container awareness, G1 GC for native images, and many more performance improvements, all in a new GraalVM version! >>...
View ArticleGuide to the System Stubs Library
1. Overview It can be hard to test our software when it depends on system resources like environment variables, system properties, or uses process-level operations like System.exit. Java doesn't...
View ArticleDigital Certificate: How to Import .cer File into Truststore File
1. Overview The SSL protocol is usually the preferred choice whenever applications need to communicate with clients over the network. Together with encryption of data, SSL makes it mandatory for an...
View ArticleSecurity Context Basics: User, Subject and Principal
1. Overview Security is a fundamental part of any Java application. Also, we can find many security frameworks that can handle security concerns. Additionally, we use a few terms commonly like the...
View ArticleThymeleaf Variables
1. Introduction In this tutorial, we're going to take a look at variables in Thymeleaf. We'll create a Spring Boot example that will fetch a list of Baeldung articles and display them in a Thymeleaf...
View ArticleNoSuchFieldError in Java
1. Overview In this article, we'll demonstrate the reason behind NoSuchFieldError and discover how to resolve it. 2. NoSuchFieldError As the name suggests, NoSuchFieldError occurs when a specified...
View ArticleJava AES Encryption and Decryption
1. Overview The symmetric-key block cipher plays an important role in data encryption. It means that the same key is used for both encryption and decryption. The Advanced Encryption Standard (AES) is a...
View ArticleIntroduction to Servlets and Servlet Containers
1. Overview In this tutorial, we'll understand conceptually what servlets and servlet containers are and how they work. We'll also see them in the context of a request, response, session objects,...
View ArticleRunning Spring Boot with PostgreSQL in Docker Compose
1. Introduction In this tutorial, we want to run a Spring Boot application with the popular open-source database PostgreSQL. In a previous article, we looked at Docker Compose to handle multiple...
View ArticleJava Weekly, Issue 362
1. Spring and Java >> Metaspace in OpenJDK 16 [lkorinth.github.io] More efficient Metaspace in JDK 16: reduced fragmentation and uncommitting the unused memory. >> JEP proposed to target...
View ArticleLight-Weight Concurrency in Java and Kotlin
1. Introduction In this tutorial, we'll explore the basic concepts of concurrency and how different programming languages address them, particularly Java and Kotlin. We'll focus primarily on the...
View ArticleSpring Boot With Spring Batch
1. Overview Spring Batch is a powerful framework for developing robust batch applications. In our previous tutorial, we introduced Spring Batch. In this tutorial, we'll build on the previous one and...
View ArticleA Guide to MultipleBagFetchException in Hibernate
1. Overview In this tutorial, we'll talk about the MultipleBagFetchException. We'll begin with the necessary terms to understand, and then we'll explore some workarounds until we reach the ideal...
View ArticleGet a Filename Without the Extension in Java
1. Overview When we work with files in Java, we often need to handle filenames. For example, sometimes we want to get the name without the extension from a given filename. In other words, we want to...
View ArticleComparing Doubles in Java
1. Overview In this tutorial, we'll talk about the different ways of comparing double values in Java. In particular, it isn't as easy as comparing other primitive types. As a matter of fact, it's...
View ArticleAdding Parameters to HttpClient Requests
1. Introduction HttpClient is part of the Apache HttpComponents project that provides a toolset of low-level Java components focused on HTTP and associated protocols. The most essential function of...
View ArticleJava Weekly, Issue 363
1. Spring and Java >> Incubator Support for HTTP/3 in Netty [netty.io] Say hello to HTTP/3 and QUIC – the first incubator support of QUIC in Netty based on Cloudflare's quiche implementation!...
View ArticleArrayList vs. LinkedList vs. HashMap in Java
1. Overview Collections in Java are based on a couple of core interfaces and more than a dozen implementation classes. The wide selection of different implementations can sometimes lead to confusion....
View ArticleJDBC URL Format For Different Databases
1. Overview When we work with a database in Java, usually we connect to the database with JDBC. The JDBC URL is an important parameter to establish the connection between our Java application and the...
View Article