Quantcast
Channel: Baeldung
Browsing all 4535 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Bootstrapping JPA Programmatically in Java

1. Overview Most JPA-driven applications make heavy use of the “persistence.xml” file for getting a JPA implementation, such as Hibernate or OpenJPA. Our approach here provides a centralized mechanism...

View Article


Image may be NSFW.
Clik here to view.

Controlling Bean Creation Order with @DependsOn Annotation

1. Overview Spring, by default, manages beans’ lifecycle and arranges their initialization order. But, we can still customize it based on our needs. We can choose either the SmartLifeCycle interface...

View Article


Image may be NSFW.
Clik here to view.

Find the Middle Element of a Linked List

1. Overview In this tutorial, we’re going to explain how to find the middle element of a linked list in Java. We’ll introduce the main problems in the next sections, and we’ll show different...

View Article

Image may be NSFW.
Clik here to view.

Convert String to Date in Java

1. Overview In this tutorial, we’ll explore several ways to convert String objects into Date objects. We’ll start with the new Date Time API – java.time that was introduced in Java 8 before looking at...

View Article

Image may be NSFW.
Clik here to view.

Spring Shutdown Callbacks

1. Overview In this tutorial, we’re going to learn different ways to use shutdown callbacks with Spring. The main advantage of using a shutdown callback is that it gives us control over a graceful...

View Article


Image may be NSFW.
Clik here to view.

Count with JsonPath

1. Overview In this quick tutorial, we’ll explore how to use JsonPath to count objects and arrays in a JSON document. JsonPath provides a standard mechanism to traverse through specific parts of a...

View Article

Image may be NSFW.
Clik here to view.

Front-End App with Spring Security OAuth – Authorization Code Flow

1. Overview In this tutorial, we’ll continue our Spring Security OAuth series by building a simple front end for Authorization Code flow. Keep in mind that the focus here is the client-side; have a...

View Article

Image may be NSFW.
Clik here to view.

Implementing a FTP-Client in Java

1. Overview In this tutorial, we’ll take a look at how to leverage the Apache Commons Net library to interact with an external FTP server. 2. Setup When using libraries, that are used to interact with...

View Article


Image may be NSFW.
Clik here to view.

Access a File from the Classpath in a Spring Application

1. Introduction In this tutorial, we’ll see various ways to access and load the contents of a file that’s on the classpath using Spring. 2. Using Resource The Resource interface helps in abstracting...

View Article


Image may be NSFW.
Clik here to view.

Warning: “The type WebMvcConfigurerAdapter is deprecated”

1. Introduction In this quick tutorial, we’ll have a look at one of the warnings we may see when working with a Spring 5.x.x version, namely the one referring to the deprecated WebMvcConfigurerAdapter...

View Article

Image may be NSFW.
Clik here to view.

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 Article

Image may be NSFW.
Clik here to view.

A 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 Article

Image may be NSFW.
Clik here to view.

Java 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 Article


Image may be NSFW.
Clik here to view.

Practical 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 Article

Image may be NSFW.
Clik here to view.

Optimistic 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 Article


Image may be NSFW.
Clik here to view.

Java 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 Article

Image may be NSFW.
Clik here to view.

Get 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 Article


Image may be NSFW.
Clik here to view.

Docker 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 Article

Image may be NSFW.
Clik here to view.

Introduction 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 Article

Image may be NSFW.
Clik here to view.

Introduction 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 Article
Browsing all 4535 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>