Authentication using a Single Page Application with PKCE in Spring...
1. Introduction In this tutorial, we’ll discuss the use of Proof Key for Code Exchange (PKCE) for OAuth 2.0 public clients. 2. Background OAuth 2.0 public clients such as Single Page Applications (SPA)...
View ArticleThe Difference Between JUnit and Mockito
1. Introduction Software testing is a crucial stage in the software development lifecycle. It helps us evaluate, identify, and improve our software’s quality. Testing frameworks help us with predefined...
View ArticleConvert a Map to a Spring MultiValueMap
1. Overview In this tutorial, we’ll convert a Map to a Spring MultiValueMap and understand it with a clear example. In the Spring Framework, a MultiValueMap is a specialized map that holds multiple...
View ArticleJava Weekly, Issue 545
1. Spring and Java >> Make Illegal States Unrepresentable – Data Oriented Programming v1.1 [inside.java] Only representing legal states: using Java records to perform the boundary validations and...
View ArticleClear the Scanner Buffer in Java
1. Introduction In Java, the Scanner class is commonly used to read input from various sources, including the console. However, Scanner can leave newline characters in the buffer, causing issues with...
View Articleload() vs. get() in Hibernate
1. Introduction In Hibernate, load() and get() are two methods used to retrieve data from the database. In this tutorial, we’ll explore the differences between these methods. 2. Loading Strategy The...
View ArticleJava 21 Improved Emoji Support
1. Overview Java 21 introduced a new set of methods in the java.lang.Character class to provide better support for emojis. These methods allow us to easily check if a character is an emoji and to check...
View ArticleValidating Linux Folder Paths using Regex in Java
1. Overview When working with file systems in Java, validating folder paths is crucial to ensure that our applications function correctly and securely. One efficient way to perform path validation is...
View ArticleCount Queries In JPA Using CriteriaQuery
1. Introduction Java Persistence API (JPA) is a widely used specification for accessing, persisting, and managing data between Java objects and a relational database. One common task in JPA...
View ArticleTestContainers With MongoDB in Java
1. Overview Test containers help us to spin up containers before running tests and stop them afterward by defining them in our code. In this tutorial, we’ll take a look at configuring TestContainers...
View ArticleIntroduction to Hibernate Reactive
1. Overview Reactive programming is a programming paradigm emphasizing the principles of asynchronous data streams and non-blocking operations. The key objective is to build applications that can...
View ArticleChecking Write Permissions of a Directory in Java
1. Introduction In Java, interacting with file systems for reading, writing, or other manipulation is a common task. Managing files and directories often involves checking their permissions. In this...
View ArticleCalculate One’s Complement of a Number
1. Introduction One’s complement is a method for representing negative numbers in binary form by inverting all the bits of the number. It’s often used in networking protocols for error detection and...
View ArticleCreate an Instance of Generic Type in Java
1. Overview Generics provide an elegant way to introduce an additional layer of abstraction in our codebase while promoting code reusability and enhancing code quality. When working with generic data...
View Article@Valid Annotation on Child Objects
1. Introduction In this tutorial, we’ll understand how to use @Valid annotation to validate objects and their nested child objects. Validating incoming data can be straightforward when it is of a basic...
View ArticleMonitoring Hibernate Events With Java Flight Recorder
1. Overview In this tutorial, we’ll examine the process of using Java Flight Recorder to record events during Hibernate lifecycle execution. After that, we’ll use the JDK Mission Control tool from...
View ArticleConverting Exponential Value to a Number Format in Java
1. Introduction Handling and converting exponential or scientific notation into a readable number format in Java is a common requirement, especially in scientific computing, financial calculations, and...
View ArticleGuide to Finding Min and Max by Group Using Stream API
1. Introduction In this tutorial, we’ll see how to group elements by value and find their minimum and maximum values in each group. We’ll need a basic knowledge of Java 8 streams to understand this...
View ArticleA Guide to ConstructorDetector in Jackson
1. Introduction One of the essential aspects of working with Jackson is understanding how it maps JSON data to Java objects, which often involves using constructors. Besides, the ConstructorDetector is...
View ArticleFinding the Size of a Web File Using URLConnection in Java
1. Overview The HTTP protocol provides comprehensive information about requested web resources. One of its header fields, Content-Length, specifies the size of a resource in bytes. We can extract this...
View Article