OpenJDK Project Loom
1. Overview In this article, we’ll take a quick look at Project Loom. In essence, the primary goal of Project Loom is to support a high-throughput, lightweight concurrency model in Java. 2. Project...
View ArticleCheck If a String Contains Multiple Keywords
1. Introduction In this quick tutorial, we’ll find out how to detect multiple words inside of a string. 2. Our Example Let’s suppose we have the string: String inputString = "hello there, Baeldung";...
View ArticleConditionally Enable Scheduled Jobs in Spring
1. Introduction The Spring Scheduling library allows applications to execute code at specific intervals. Because the intervals are specified using the @Scheduled annotation, the intervals are typically...
View ArticleSpring Data JPA Query by Example
1. Introduction In this tutorial, we’re going to learn how to query data with the Spring Data Query by Example API. First, we’ll define the schema of the data we want to query. Next, we’ll examine a...
View ArticleSpring Dependency Injection
Dependency Injection is a fundamental aspect of the Spring framework, through which the Spring container “injects” objects into other objects or “dependencies”. Simply put, this allows for loose...
View ArticleNotify User of Login From New Device or Location
1. Introduction In this tutorial, we’re going to demonstrate how we can verify if our users are logging in from a new device/location. We’re going to send them a login notification to let them know...
View ArticleList Files in a Directory in Java
1. Overview In this quick tutorial, we’ll look into different ways to list files within a directory. 2. Listing If we want to list all the files in the directory and skip further digging into...
View ArticleJava Weekly, Issue 266
Here we go… 1. Spring and Java >> Testing CDI Beans and the Persistence Layer Under Java SE [in.relation.to] A good write-up on using Weld to test interactions between the JPA layer and the...
View ArticleJava Bitwise Operators
1. Overview Operators are used in the Java language to operate on data and variables. In this tutorial, we’ll explore Bitwise Operators and how they work in Java. 2. Bitwise Operators Bitwise operators...
View ArticleList of Primitive Integer Values in Java
1. Overview In this tutorial, we’ll learn how to construct a list containing primitive integer values. We’ll explore solutions using core Java and external libraries. 2. Autoboxing In Java, generic...
View ArticleCommon String Operations in Java
1. Introduction String-based values and operations are quite common in everyday development, and any Java developer must be able to handle them. In this tutorial, we’ll provide a quick cheat sheet of...
View ArticleJava Classes and Objects
1. Overview In this quick tutorial, we’ll look at two basic building blocks of the Java programming language – classes and objects. They’re basic concepts of Object Oriented Programming (OOP), which we...
View ArticleA Solid Guide to SOLID Principles
1. Introduction In this tutorial, we’ll be discussing the SOLID principles of Object-Oriented Design. First, we’ll start by exploring the reasons they came about and why we should consider them when...
View ArticleMethod References in Java
1. Overview One of the most welcome changes in Java 8 was the introduction of lambda expressions, as these allow us to forego anonymous classes, greatly reducing boilerplate code and improving...
View ArticleAccessing Spring MVC Model Objects in JavaScript
1. Overview In this tutorial, we’re going to show how to access Spring MVC objects in JSP views that contain JavaScript code. We’ll use Spring Boot and the JSP template engine in our examples, but the...
View ArticleAnnouncing “Learn Spring”
The New Course “How do I get started with Spring?” is, by far, the most common question I get. Probably next to “What does Baeldung actually mean?” – there’s a thread on Quora if you’re curious The...
View ArticleGuice vs Spring – Dependency Injection
1. Introduction Google Guice and Spring are two robust frameworks used for dependency injection. Both frameworks cover all the notions of dependency injection, but each one has its own way of...
View ArticleDifferences Between Oracle JDK and OpenJDK
1. Introduction In this article, we’ll explore the differences between Oracle Java Development Kit and OpenJDK. We’ll first take a quick look at each of them and then make a comparison. After that,...
View ArticleValidation in Spring Boot
1. Overview When it comes to validating user input, Spring Boot provides strong support for this common, yet critical, task out of the box. Although Spring Boot supports seamless integration with...
View ArticleMarker Interfaces in Java
1. Introduction In this quick tutorial, we’ll learn about marker interfaces in Java. 2. Marker Interfaces A marker interface is an interface that has no methods or constants inside it. It provides...
View Article