Learn two different ways to format an instant as a string – one using core Java and the other using the Joda-Time library.
Also find me here:
Baeldung Editor
Kevin Gilmore
Kevin Gilmore is a software developer in Austin, Texas, and he's been writing code in Java for over 15 years. For the past five years, he has focused mainly on back-end web development using the Spring framework, Spring Data with JPA and Hibernate, Spring MVC, and Spring Boot, and prior to that, he dabbled in DevOps before DevOps was cool. When he's not creating software, he enjoys music, sports, and writing flash fiction and poetry.
Here's what I've reviewed (so far):
Baeldung
- All
- Java (29)
- Spring Boot (22)
- Spring (21)
- Testing (18)
- Spring MVC (18)
- Core Java (15)
- REST (13)
- Persistence (13)
- Algorithms (12)
- Spring Security (11)
- DevOps (10)
- Data (10)
- Spring Data (9)
- Java String (7)
- Java Collections (7)
- Jakarta EE (7)
- Maven (6)
- Java IO (6)
- Spring Web (5)
- Security (5)
- NoSQL (5)
- Logging (5)
- Java Concurrency (5)
- JSON (5)
- HTTP Client-Side (5)
- Cloud (5)
- Architecture (5)
- Spring Persistence (4)
- Java Dates (4)
- Java Array (4)
- Jackson (4)
- JPA (4)
- XML (3)
- Spring Cloud (3)
- Reactive (3)
- Java Streams (3)
- Java Numbers (3)
- Java Map (3)
- JVM (2)
- IDE (2)
- Guava (1)
- Groovy (1)
- Gradle (1)
HttpMessageNotWritableException: No Converter for [class …] With Preset Content-Type
Filed under Spring Web
Learn what causes Spring to throw HttpMessageNotWritableException with the message “No converter for [class …] with preset Content-Type” and how to solve it.
An Introduction to Domain Graph Service (DGS) Framework
Filed under Spring Boot
Learn how to use the Domain Graph Service (DGS) Framework from Netflix to build a simple Spring Boot GraphQL service in Java.
Check if a String Ends with a Certain Pattern in Java
Filed under Java String
Learn how to check if a String ends in a certain pattern in Java using core Java methods as well as Apache Commons Lang’s StringUtils class.
Split a String Every n Characters in Java
Filed under Java String
Learn several ways to split a string after every n characters in Java.
Is Cassandra a Column-Oriented or Column-Family Database?
Filed under NoSQL
Learn how Cassandra stores data in a partitioned row store and how this differs from a column-oriented data store.
Kafka Streams With Spring Boot
Filed under Spring Boot
Learn how to build a simple event-driven Spring Boot application to process messages with Kafka Streams.
Generate PDF from Swagger API Documentation
Filed under REST
Learn how to generate a PDF document from an OpenAPI Swagger definition using Maven plugins and the online Swagger To PDF tool.
Adding a Column to an Excel Sheet Using Apache POI
Filed under Java IO
Learn how to add a column to an Excel sheet using Java with the Apache POI library.
Importing Maven Project into Eclipse
Filed under Maven
Learn how to import a Maven project into Eclipse.
Omitting Getter or Setter in Lombok
Filed under Java
Learn how to skip the generation of individual getters and setters when using Lombok annotations.
Introduction to HexFormat in Java 17
Filed under Java String
Learn how easy it is to convert between bytes and hexadecimal strings with the updated HexFormat class in Java 17.
Introduction to the Evrete Rule Engine
Filed under Java
Learn about Evrete, a new open-source Java rule engine designed to allow developers to create arbitrary DSLs.
Update the Value Associated With a Key in a HashMap
Filed under Java Map
Learn several methods for updating the value associated with a HashMap key using core Java.
Trusting All Certificates in OkHttp
Filed under HTTP Client-Side
Learn how to create an OkHttpClient and configure it to trust all certificates — not the best practice in production, but you may need it from time to time during development or testing.
Cassandra Frozen Keyword
Filed under NoSQL, Persistence
Learn about the frozen keyword in Apache Cassandra and how to create frozen collections and user-defined types.
Guide to Using ModelMapper
Filed under Java
Learn how to map our data between differently structured objects using ModelMapper by creating custom class-to-class mappings with property mappers.
Add a Reference to Method Parameters in Javadoc
Filed under Java
Learn how to create references to method parameters in Javadoc.
HTML to PDF Using OpenPDF
Filed under Java IO
Learn how to convert HTML to PDF in Java using OpenPDF and Flying Saucer or using the Open HTML to PDF library, with a little help from Jsoup.
Priority of a Thread in Java
Filed under Java Concurrency
Learn about Thread priority values in Java, how to set them, and how the Java scheduler uses them to prioritize threads to execute.
Gradle Offline Mode
Filed under Gradle
Learn how to use Gradle in offline mode, whether you’re working from the command line, IntelliJ IDEA, or Eclipse.
Choosing a GC Algorithm in Java
Filed under JVM
Learn about the various garbage collectors supported by the JVM and some key characteristics that can help us decide on the right one to use, depending on our application’s needs.
Converting a PEM File to Java KeyStore Format
Filed under Security
Learn how to convert certificates from a PEM (Privacy Enhanced Email) file to JKS (Java KeyStore) format using the openssl and keytool command-line utilities.
“Code too large” Compilation Error in Java
Filed under Java
Learn what causes the compiler error “code too large”, along with situations where we might encounter it and what we can do to fix it.
Different Serialization Approaches for Java
Filed under Java
Learn several approaches for serializing Java objects using third-party libraries or core Java’s built-in serialization API.
JPA Entities and the Serializable Interface
Filed under JPA
Learn when and why to use the Serializable interface in JPA entities according to the JPA specification.
Exchanges, Queues, and Bindings in RabbitMQ
Filed under Data
Learn about exchanges, queues, and bindings in RabbitMQ and how to work with them in Java.
Log4j Warning: “No Appenders Could Be Found for Logger”
Filed under Logging
Learn why the Log4j warning, “No appenders could be found for logger” occurs and how to resolve it, both in configuration and in Java code.
Defining Unique Constraints in JPA
Filed under JPA
Learn how to define unique constraints on entity classes in JPA and Hibernate.
How to Display a Message in Maven
Filed under Maven
Learn how to print messages to the console or to a file during a Maven build using various plugins.
Code Coverage with SonarQube and JaCoCo
Filed under Testing
A guide to measuring code coverage using SonarQube and JaCoCo.
HTTP PUT vs. POST in REST API
Filed under REST, Spring Boot
Learn the differences between HTTP POST and PUT methods and when to use each in a RESTful API.
Converting a Java Keystore Into PEM Format
Learn how to convert certificates and private keys from a Java KeyStore into PEM format using keytool and openssl.
How to Handle InterruptedException in Java
Filed under Java Concurrency
Learn about Java’s InterruptedException, what causes it, and how to handle it.
Long Polling in Spring MVC
Filed under Spring MVC
Learn how to implement long polling in Spring MVC using DeferredResult and how to test it.
The package-info.java File
Filed under Java
Learn about the package-info.java file, what its purpose is, and how we can use it to specify package-level Javadocs and annotations.
Introduction to ZeroCode
Filed under Testing
Learn the fundamentals of the ZeroCode automated testing framework, including the declarative style of its DSL for describing tests with a minimal amount of code.
How to Use Visual Studio Code With Java?
Filed under IDE
Learn how to get up-and-running with Visual Studio Code support for Java.
Where Should the Spring @Service Annotation Be Kept?
Filed under Spring
Learn where to put the @Service annotation so that Spring will auto-detect beans during component scanning.
Evaluating a Math Expression in Java
Filed under Java Numbers
Learn how to evaluate math expressions expressed in String format in Java using exp4j, Javaluator, and the Java Scripting API.
Check if a Java Program Is Running in 64-Bit or 32-Bit JVM
Filed under JVM
Learn how a Java program can detect whether it’s running in a 64-bit or 32-bit JVM.
Set JWT with Spring Boot and Swagger UI
Filed under Security, Spring Boot, Spring Web
Learn how to set a JSON Web Token on requests to Swagger UI running in Spring Boot.
Getting Database URL From JDBC Connection Object
Filed under Persistence
Learn how to obtain the database URL from a JDBC Connection object.
Creational Design Patterns in Core Java
Filed under Architecture, Core Java
Learn about creational design patterns along with examples of core Java classes that use them to create and obtain instances of objects.
Checking if a Java Class Is ‘Abstract’ Using Reflection
Filed under Java
Learn how to check whether a Java class is abstract using the Reflection API.
JSON Parameters with Spring MVC
Filed under JSON, Spring MVC
Learn how to send JSON parameters in GET and POST requests when using Spring MVC.
Social Login with Spring Security in a Jersey Application
Filed under Spring Security
Learn how to protect a Spring Boot Jersey application with Spring Social login and OAuth2.
Testing Quarkus Applications
Learn how to write clean and powerful unit and integration tests for Quarkus applications.
Extracting Database Metadata Using JDBC
Filed under Persistence
Learn how to retrieve database metadata using a JDBC connection and the DatabaseMetaData interface.
Jess Rule Engine and JSR 94
Filed under Java
Learn how to integrate the Jess rule engine into a Java application and how to use Jess with JSR 94, the Java Rule Engine API.
The Spring ApplicationContext
Filed under Spring
Learn about the ApplicationContext interface in Spring and how to configure beans in some of the more common types of ApplicationContext.
Reading the Value of ‘private’ Fields from a Different Class in Java
Filed under Java
Learn how to access the private fields of another class and read their values using the Java Reflection API.
When Does JPA Set the Primary Key
Filed under JPA
Learn about the different strategies JPA uses to generate the primary key for an entity and at which moment each strategy sets the key value during persistence.
Spring @Import Annotation
Filed under Spring
Learn how and when to use the @Import annotation in Spring and how it’s different from @ComponentScan.
Quick Guide to Spring Cloud Open Service Broker
Filed under Spring Cloud
Learn how to implement the Open Service Broker API using Spring Cloud Open Service Broker.
Encode a String to UTF-8 in Java
Filed under Java String
Learn how to encode a Java String to the UTF-8 character set.
Mocking the ObjectMapper readValue() Method
Learn how to mock the Jackson ObjectMapper’s readValue method with Mockito.
HTTP/2 in Jetty
Filed under DevOps
Learn how to configure a Jetty server-side application with HTTP/2 Push support.
Java Thread Deadlock and Livelock
Filed under Java Concurrency
Learn how to recognize and avoid deadlock and livelock in multi-threaded Java applications.
Quick Guide to EntityManager#getReference()
Filed under JPA
Learn how Hibernate’s EntityManager#getReference method works in various use cases.
List All Redis Databases
Filed under DevOps, Persistence
Learn several ways to list all databases in a Redis instance.
Introduction to cache2k
Filed under Java
Learn how to use cache2k, a lightweight in-memory Java caching library.
Guide to the @Serial Annotation in Java 14
Filed under Core Java
Learn how to apply the @Serial annotation in Java 14 to assist with compile-time checks on serializable properties of a class.
Range Search Algorithm in Java
Filed under Algorithms
Learn how to use a quadtree data structure in Java to perform a range search on data points in a two-dimensional space.
Guide to WebRTC
Filed under HTTP Client-Side
Learn how to build a direct, real-time communication channel between two browsers, mobile apps, or other HTML clients using WebRTC.
Overview of Combinatorial Problems in Java
Filed under Algorithms
Learn algorithms for solving a few common combinatorial problems and how to implement them in Java.
Guide to Flash Attributes in a Spring Web Application
Filed under Spring MVC
Learn how to use Spring’s flash attributes to implement the Post/Redirect/Get form submission workflow.
Documenting a Spring REST API Using OpenAPI 3.0
Learn how to generate OpenAPI 3.0 specifications for a Spring REST API using SpringDoc.
Hibernate Error “Not all named parameters have been set”
Filed under Persistence
Learn what causes the Hibernate error “Not all named parameters have been set” and how to avoid it.
Programmatic Transaction Management in Spring
Filed under Spring Persistence
Learn to manage transactions programmatically in Spring and why this approach is sometimes better than simply using the declarative Transactional annotation.
Using Enums as Request Parameters in Spring
Filed under Spring MVC
Learn how to use enums as request parameters in Spring REST controllers and how to handle exceptions triggered by invalid input.
Spring Security – Attacking OAuth
Filed under Spring Security
Explore an OAuth attack based on redirection URLs and how to mitigate them with absolute URL matching.
Methods in Java
Filed under Core Java
Learn all about methods in Java, from basic method syntax to overloading, as well as how to call methods.
Using a Slash Character in Spring URLs
Filed under Spring MVC, Spring Web
Learn several ways to deal with URLs containing slash characters in Spring.
Convert XML to HTML in Java
Filed under XML
Learn several ways to convert XML to HTML in Java.
Intro to DataStax Java Driver for Apache Cassandra
Filed under NoSQL, Persistence
Learn how to work with Cassandra databases using the DataStax Java Driver for Apache Cassandra.
Java ‘private’ Access Modifier
Filed under Core Java
Learn all about the ‘private’ access modifier in Java.
Building Java Applications with Bazel
Filed under DevOps
Learn how to build Java applications using the Bazel build tool.
Calling Default Serializer from Custom Serializer in Jackson
Filed under Jackson
Learn how to call Jackson’s default serializers within a custom serializer.
Creating a Triangle with for Loops in Java
Filed under Algorithms
Learn several ways to print triangles in Java using for loops.
MyBatis with Spring
Filed under Persistence, Spring
Have a look at how to integrate MyBatis with Spring and Spring Boot.
Java ‘Hello World’ Example
Filed under Java
Learn how to write, compile, and execute a basic ‘Hello World’ program in Java.
Modifying an XML Attribute in Java
Filed under XML
Learn how to modify attributes in an XML document using Java with JAXP, dom4j, and jOOX
Guide to Java Parallel Collectors Library
Filed under Java Concurrency, Java Streams
Learn how to use Parallel Collectors, a library of Java Stream API collectors designed to overcome limitations of standard Parallel Streams.
Checking If a List Is Sorted in Java
Filed under Java Collections
Learn several algorithms for checking whether a list is sorted in Java.
Working with XML in Groovy
Learn several approaches for creating and editing XML using the Groovy language.
Refactoring in Eclipse
Filed under IDE
Learn how to apply several refactoring operations in the Eclipse Java IDE.
Understanding the NumberFormatException in Java
Filed under Java Numbers
Learn the various causes of NumberFormatException in Java and some best practices for avoiding it.
Multi-Module Maven Application with Java Modules
Filed under Maven
Learn to create a multi-module Maven application using the Java Platform Module System (JPMS).
Spring Data Web Support
Filed under REST, Spring Data, Spring MVC
Learn how Spring Data Web Support uses resolvers to reduce boilerplate code and make our REST Controllers more expressive.
Avoid Check for Null Statement in Java
Filed under Java
Learn several strategies for avoiding the all-too-familiar boilerplate conditional statements to check for null values in Java.
The Dependency Inversion Principle in Java
Filed under Architecture
Learn the fundamentals of the Dependency Inversion Principle through examples written in Java 8 and in the Java 11 module system.
REST-assured Support for Spring MockMvc
Filed under REST, Spring MVC, Testing
Learn how to test Spring REST controllers using the RestAssuredMockMvc API from REST-assured.
Resolving “Failed to Configure a DataSource” Error
Filed under Spring Boot, Spring Data
Learn what causes the Spring Boot error “Failed to configure a DataSource” and how to resolve it
Building a Web Application with Spring Boot and Angular
Filed under Spring Boot, Spring Web
Have a look into building a web application with a Spring REST back-end and Angular front-end.
Guide to Stream.reduce()
Filed under Java Streams
Learn the key concepts of the Stream.reduce() operation in Java and how to use it to process sequential and parallel streams.
Convert String to JsonObject with Gson
Filed under JSON
Learn a couple of methods for converting a JSON String into a JsonObject using the Gson library in Java.
JUnit 5 Conditional Test Execution with Annotations
Filed under Testing
Learn how to use JUnit 5 annotations to specify the conditions under which your tests should run.
Guide to Apache Commons MultiValuedMap
Filed under Java Map
Learn how to use MultiValuedMap from the Apache Commons Collections library to map each key to a collection of values in Java.
How to Test the @Scheduled Annotation
Learn how to test the @Scheduled annotation in Spring with a simple integration test and the Awaitility library.
Validation in Spring Boot
Filed under Spring Boot
Learn how to validate domain objects in Spring Boot using Hibernate Validator, the reference implementation of the Bean Validation framework.
Configuring a DataSource Programmatically in Spring Boot
Filed under Spring Boot, Spring Data
Learn how to configure a Spring Boot DataSource programmatically, thereby side-stepping Spring Boot’s automatic DataSource configuration algorithm.
Multi Dimensional ArrayList in Java
Filed under Java Collections
Learn how to create and work with multidimensional ArrayLists in Java.
Integrating Spring Boot with HSQLDB
Filed under Spring Boot, Spring Data
Learn how to use HSQLDB in the JPA persistence layer of a Spring Boot application.
Replace a Character at a Specific Index in a String in Java
Filed under Java String
Learn several methods for replacing a character at a specific index in a Java String.
Building a Basic UAA-Secured JHipster Microservice
Filed under Security
Learn how to build a UAA-secured microservice using JHipster without writing a single line of code.
Testing Reactive Streams Using StepVerifier and TestPublisher
Learn how to use StepVerifier and TestPublisher to test reactive streams in a sample Spring Reactor project.
Calculate Factorial in Java
Filed under Algorithms
Learn several ways to calculate factorials in Java.
Find Substrings That Are Palindromes in Java
Filed under Algorithms
Learn several algorithms for finding all palindromes within a given string in Java.
Connecting Through Proxy Servers in Core Java
Filed under HTTP Client-Side, Java
Learn how to connect to proxy servers in Java using system properties or the more flexible Proxy class.
Join Array of Primitives with Separator in Java
Filed under Java Array
Learn how to join an array of primitives with a separator character or string in Java.
Introduction to the Event Notification Model in CDI 2.0
Filed under Jakarta EE
Learn how to use the improved event notification model available in CDI 2.0.
Abstract Classes in Java
Filed under Core Java
Learn how and when to use abstract classes as part of a class hierarchy in Java.
Customizing HTTP Endpoints in Spring Data REST
Filed under REST, Spring Data
Learn how to restrict which repository methods are exposed as endpoints in a Spring Data REST application, as well as how to customize their URL mappings.
Installing Java on Ubuntu
Learn how to install OpenJDK and Oracle JDK versions 8 through 11 on Ubuntu systems.
Generate a Secure Random Password in Java
Learn several methods for generating secure random passwords in Java.
Understanding Memory Leaks in Java
Filed under Core Java
Learn what memory leaks are in Java, how to recognize them at runtime, what causes them, and strategies for preventing them.
Using indexOf to Find All Occurrences of a Word in a String
Filed under Java String
Learn how to solve the “needle in a haystack” problem by using the indexOf method to find all occurrences of a word in a larger text string.
Convert JSON to a Map Using Gson
Filed under JSON
Learn how to use Google’s Gson library to convert a JSON string to a HashMap in Java.
Display Auto-Configuration Report in Spring Boot
Filed under Spring Boot
Learn which beans are automatically configured in your Spring Boot application by generating an auto-configuration report during startup.
An Introduction to Synchronized Java Collections
Filed under Java Collections, Java Concurrency
Learn how to create synchronized collections using the static synchronization wrappers available in the Java Collections Framework.
Difference Between @NotNull, @NotEmpty, and @NotBlank Constraints in Bean Validation
Filed under Jakarta EE
Learn the semantics of the @NotNull, @NotEmpty, and @NotBlank bean validation annotations in Java and how they differ.
Access the Same In-Memory H2 Database in Multiple Spring Boot Applications
Filed under Spring Boot, Spring Persistence
Learn how to start an in-memory H2 database in one Spring Boot application and access the same database in another over TCP.
OAuth2 – @EnableResourceServer vs @EnableOAuth2Sso
Filed under Spring Security
Learn how to set up an OAuth2 Client and Resource Server using Spring’s @EnableResourceServer and @EnableOAuth2Sso annotations.
Spring WebSockets: Send Messages to a Specific User
Filed under Spring
Learn how to send STOMP messages to a specific user in Spring WebSockets.
Convert java.util.Date to String
Filed under Java Dates
Learn several methods for converting Date objects to String objects in Java.
How to Disable Console Logging in Spring Boot
Filed under Logging, Spring Boot
Learn how to configure a Spring Boot application so that it does not log to the console, whether it is using Logback, Log4j2, or Java Util Logging.
Configuring a Tomcat Connection Pool in Spring Boot
Filed under Persistence, Spring Boot
Learn how to configure a Spring Boot JPA application to use the Tomcat JDBC Connection Pool.
Iterate Through a Range of Dates in Java
Filed under Java Dates
Learn some practical ways to iterate over a range of date values, whether you’re using Java 7, 8, or 9 and above.
Removing the First Element of an Array
Filed under Java Array
Have a look at ways to remove the first element of an array in Java
Java Constructors vs Static Factory Methods
Filed under Core Java
Learn about static factory methods in Java and why they’re sometimes preferred over constructors for instantiating and initializing objects.
Spring MVC Streaming and SSE Request Processing
Filed under Spring MVC
Learn how to produce asynchronous and streaming data responses using Spring MVC 5 and consume them with a simple AJAX client.
Test a REST API with curl
Filed under REST
Learn how to test HTTP GET, POST, PUT, and DELETE using curl
Add Hours to a Date in Java
Filed under Java Dates
Learn several ways to add or subtract a given number of hours from a date in Java.
Context and Servlet Initialization Parameters
Filed under Jakarta EE
Learn how to define and access context and servlet initialization parameters in a Java HTTP servlet application.
Introduction to AWS Serverless Application Model
Filed under Architecture, Cloud
Learn how to define and automatically deploy a serverless application in AWS.
Read and Write User Input in Java
Filed under Java IO
Learn how to get user input and handle user output with the console in a Java application.
Using AWS Lambda with API Gateway
Learn how to publish a lambda function as a REST endpoint in Amazon Web Services using API Gateway.
Logging in Spring Boot
Filed under Logging, Spring Boot
Learn how to easily configure the most popular logging solutions in a Spring Boot application.
Spring with Thymeleaf Pagination for a List
Filed under Spring MVC
Learn how to leverage Thymeleaf and Spring Data Commons to paginate through a list of items in your Spring Web UI.
The DAO Pattern in Java
Filed under Persistence
Learn how to implement the Data Access Object (DAO) pattern in Java to isolate the persistence and business layers of your application.
Importance of Main Manifest Attribute in a Self-Executing JAR
Learn how to create a self-executing JAR by specifying the main class as an attribute in the Manifest file.
Java 8 Unsigned Arithmetic Support
Filed under Java Numbers
Learn the ins and outs of working with unsigned integers in Java 8 and later.
Multi-Module Project With Spring Boot
Filed under Maven, Spring Boot
Learn how to create a Spring Boot library JAR as a Maven module and use it in a Spring Boot application module.
Bootstrapping JPA Programmatically in Java
Filed under Persistence
Learn how to configure a JPA persistence context in Java without the traditional persistence.xml file.
Configure a RestTemplate with RestTemplateBuilder
Filed under HTTP Client-Side, Spring Web
Learn three different approaches for configuring a RestTemplate bean in Spring.
Using Lombok’s @Builder Annotation
Filed under Java
Learn how the @Builder annotation in Project Lombok can help you reduce boilerplate code when implementing the builder pattern to create instances of your Java classes.
Spring Web Contexts
Filed under Spring
Learn about the common ways of configuring and organizing application contexts in a Spring web application.
The Command Pattern in Java
Filed under Java
Learn how to implement the Command Pattern in Java using object-oriented and object-functional approaches.
Managing Amazon SQS Queues in Java
Filed under Cloud
Learn how to use the Amazon Simple Queue Service (SQS) to manage message queues in Java.
Spring Data JPA @Query
Filed under Spring Data
Learn how to use the @Query annotation in Spring Data JPA to define custom queries using JPQL and native SQL.
Find All Pairs of Numbers in an Array That Add Up to a Given Sum in Java
Filed under Algorithms, Java Array
A quick look at several algorithms for finding pairs of numbers in an array that add up to a given sum in Java using traditional for loops and the Java 8 Stream API.
Working with Fragments in Thymeleaf
Filed under Spring MVC
Learn how to create reusable view components with Thymeleaf fragments to simplify template management.
Introduction to Spring Boot CLI
Filed under Spring Boot
Learn how to quickly scaffold Spring micro-services using Spring CLI terminal commands and Groovy scripts.
Inheritance and Composition (Is-a vs Has-a relationship) in Java
Filed under Core Java
Learn the differences between inheritance and composition relationships in Java.
Combining Observables in RxJava
Filed under Reactive
Learn several methods for combining Observable sequences in RxJava.
The “final” Keyword in Java
Filed under Core Java
Learn what the final keyword in Java means when applied to classes, methods, and variables.
How to Make a Deep Copy of an Object in Java
Filed under Core Java
Learn four ways to create a deep copy of an object in Java, and why to prefer a deep copy over a shallow copy.
An Intro to Spring Cloud Contract
Filed under Spring Cloud
Learn to write and test Consumer-Driven Contracts using Spring Cloud Contract.
Method Overloading and Overriding in Java
Filed under Core Java
Learn the basics of method overloading and overriding in Java.
Feature Flags with Spring
Filed under Architecture, Spring
Learn how feature flags can help you to enable or disable different functionality in your Spring Boot application without recompiling or redeploying.
Shuffling Collections in Java
Filed under Java Collections
Learn how to shuffle various collections in Java.
Introduction to Jinq with Spring
Filed under Spring Persistence
Learn how to use the Jinq database query library for Java 8 in a Spring application.
Changing Tomcat HTTP Port to 80
Filed under DevOps
Learn how to configure an Apache Tomcat HTTP server to run on port 80.
Spring 5 and Servlet 4 – The PushBuilder
Filed under Jakarta EE, Spring MVC
Learn how to use the PushBuilder in Spring MVC to take advantage of the HTTP/2 server push technology.
Integration Guide for Spring and EJB
Filed under Jakarta EE, Spring
Learn how to integrate Enterprise Java Beans into a Spring application.
How to Find the Kth Largest Element in Java
Filed under Algorithms
Learn several approaches for finding the kth largest element in a set of unique numbers using Java.
Static and Default Methods in Interfaces in Java
Filed under Core Java
Learn how to write and use static and default methods in Java interfaces.
Guide to JSpec
Filed under Testing
Learn to write tests in Java by asserting specifications using the JSpec framework.
Guide to the Cipher Class
Filed under Core Java
Learn how to use the Cipher class to perform cryptographic data encryption and decryption in Java.
How to Reverse an Array in Java
Filed under Java Array
Learn several approaches to inverting arrays in Java.
JUnit 5 @Test Annotation
Filed under Testing
A quick and practical guide to the @Test annotation in JUnit 5.
Guide to Java String Pool
Filed under Java String
Learn how the JVM optimizes the amount of memory allocated to String storage in the Java String Pool.
Introduction to Spring Cloud Stream
Filed under Spring Cloud
Learn how to create message-driven and event-driven microservices using Spring Cloud Stream and RabbitMQ.
Apache Maven Standard Directory Layout
Filed under Maven
A quick introduction to the standard directories and files found in a typical Maven project.
REST API Testing with Karate
Learn how to test your REST API with Karate, a BDD-inspired testing framework for Java.
Mockito and JUnit 5 – Using ExtendWith
Filed under Testing
Learn how to automatically inject mocks into Mockito tests using the JUnit 5 extension model.
Mapping Nested Values with Jackson
Learn three ways to deserialize nested JSON values in Java using the Jackson library.
A Guide to Java Bytecode Manipulation with ASM
Filed under Java
Learn how to modify an existing Java class by manipulating its bytecode using the ASM framework.
Introduction to Caffeine
Filed under Java
Learn how to use the high-performing Caffeine caching library for Java.
A Guide to Java Profilers
Filed under DevOps
A quick overview of four popular Java profilers and how they can help you find areas in your code that could benefit from optimization.
Introduction to Conflict-Free Replicated Data Types
A quick, practical guide to conflict-free replicated data types and associated strategies for merging divergent data when recovering from a network partition.
Granted Authority Versus Role in Spring Security
Filed under Spring Security
A quick guide to the difference between a granted authority and a role in Spring Security.
Collection Factory Methods for Vavr
Filed under Java
A quick and practical guide to the factory methods for creating Vavr collections in Java using Scala-like syntax.
Introduction to GeoTools
Filed under Java
A quick and practical guide to working with geospatial data in Java using the GeoTools open source library.
Guide to the Diamond Operator in Java
Filed under Core Java
A quick and practical guide to the diamond operator that was introduced in Java 7.
Apache Commons IO
Filed under Java IO
A quick and practical guide to the Apache Commons IO open source library for Java covering many of its better-known features.
Quick Guide to the Spring @Enable Annotations
Filed under Spring
A quick overview of @Enable annotations in Spring and how they can help to configure an application.
Using Spring @Value With Defaults
Filed under Spring
A quick and practical guide to setting default values when using the @Value annotation in Spring.
Quick Guide to RSS with Rome
Filed under Data
A quick and practical guide to reading, publishing, and editing RSS feeds in Java using Rome API.
Guide to Apache Commons CircularFifoQueue
Filed under Java Collections
A quick and practical guide to the CircularFifoQueue data structure from Apache Commons.
Data Modeling in Cassandra
Filed under NoSQL, Persistence
A quick and practical guide to designing Cassandra schemas based on query patterns to achieve better performance.
Guide to the HyperLogLog Algorithm in Java
Filed under Algorithms, Data
A quick and practical guide to HyperLogLog for estimating the cardinality of large data sets in Java.
Intro to Security and WebSockets
Filed under Spring MVC, Spring Security
A quick and practical tutorial on how to add security to WebSockets in a Spring MVC application.
Bloom Filter in Java using Guava
Filed under Guava
A quick and practical guide to the Bloom filter, a probabilistic data structure, and how to use its implementation in the Guava library.
Apache Commons Collections OrderedMap
Filed under Java Map
A quick and practical guide to the OrderedMap interface and implementations from the Apache Commons Collections library.
Locality-Sensitive Hashing in Java Using Java-LSH
Filed under Algorithms, Java
A quick and practical guide to applying the Locality-Sensitive Hashing algorithm in Java using the java-lsh library.
Top Spring Framework Interview Questions
Filed under Spring
A quick discussion of common questions about the Spring Framework that might come up during a job interview.
Testing with JGoTesting
Filed under Testing
A quick and practical guide to testing Java applications with JGoTesting, a JUnit-compatible framework.
Guide to Akka Streams
A quick and practical guide to data stream transformations in Java using the Akka Streams library.
Testing with Google Truth
Filed under Testing
A quick and practical guide to the Google Truth testing framework for Java.
How to Add a Single Element to a Stream
Filed under Java Streams
A quick tutorial describing how to add an element to the beginning, end, or middle of a Java 8 Stream.
Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java
Filed under Java IO
A quick review of the differences between three methods for obtaining the filesystem path of a File object in Java.
Call Methods at Runtime Using Java Reflection
Filed under Core Java
A quick and practical guide to runtime method invocation using the Java Reflection API.
Do a Simple HTTP Request in Java
Filed under HTTP Client-Side, Java
A quick and practical guide to performing basic HTTP requests using Java’s built-in HttpUrlConnection.
HashSet and TreeSet Comparison
Filed under Java Collections
A quick review of the similarities and differences between HashSet and TreeSet in Java.
An Intro to the Spring DispatcherServlet
Filed under Architecture, Spring MVC
A quick and practical guide to the request processing workflow of Spring’s DispatcherServlet with a focus on the HandlerAdapter interfaces.
Introduction to the Stripe API for Java
Filed under Spring Boot
A quick and practical guide to charging a credit card using the Stripe API for Java.
Create a Custom Auto-Configuration with Spring Boot
Filed under Spring Boot
A quick, practical guide to creating a custom auto-configuration in Spring Boot.
Spring Remoting with AMQP
Filed under Spring
A quick, practical guide explaining how to use Spring Remoting with AMQP to perform synchronous remote procedure calls over an asynchronous medium.
Introduction to Apache Flink with Java
Filed under Data
A practical guide to processing batch and stream data with the Apache Flink API for Java.
Dynamic DTO Validation Config Retrieved from the Database
Filed under Persistence, Spring Boot
A quick, practical guide to creating a custom, dynamic DTO validation annotation that retrieves its configurations from a database.
Introduction to Jenetics Library
Filed under Algorithms
A quick, practical guide to using the Jenetics library for Java to find solutions to several well-known optimization problems.
Configuring Separate Spring DataSource for Tests
Filed under Spring Data, Testing
A quick, practical tutorial on how to configure a separate data source for testing in a Spring application.
List of In-Memory Databases
Filed under Persistence
A quick review of how to configure some of the more popular in-memory databases for a Java application.
Create a Custom FailureAnalyzer with Spring Boot
Filed under Spring Boot
A quick, practical guide to using a custom FailureAnalyzer in Spring Boot to provide a more helpful error message when an application startup failure occurs.
Map Serialization and Deserialization with Jackson
A quick and practical guide to serializing and deserializing Java Maps using Jackson.
Guide to Java 8 Comparator.comparing()
Filed under Java
A practical guide to the static functions and instance methods of the Comparable interface that were introduced in Java 8.
Self-Contained Testing Using an In-Memory Database
Filed under Spring Persistence, Testing
A quick, practical tutorial on setting up an in-memory database for running self-contained persistence-layer tests in a Spring application.
Form Validation with AngularJS and Spring MVC
Filed under Spring MVC
A quick, practical guide on how to validate form input using AngularJS client-side and Spring MVC server-side validation.
Guide to Internationalization in Spring Boot
Filed under Spring Boot
A quick, practical guide to internationalization in Spring Boot.
Testing an OAuth Secured API with Spring MVC (using the Spring Security OAuth legacy stack)
Filed under Spring MVC, Spring Security, Testing
A quick, practical guide to testing an API secured by OAuth with the Spring MVC test support.
Multiple Entry Points in Spring Security
Filed under Spring Security
A quick, practical guide to configuring multiple entry points in Spring Security.
Guide to Google Guice
Filed under Java
A quick, practical guide to dependency injection in Google Guice.
Ant Colony Optimization with a Java Example
Filed under Algorithms
A quick tutorial on the ant colony optimization genetic algorithm in Java.
AngularJS CRUD Application with Spring Data REST
Filed under REST, Spring Data
A quick guide to creating a CRUD application using AngularJS and Spring Data REST.
How to Register a Servlet in Java
Filed under Jakarta EE, Spring
A practical guide to registering servlets in Jakarta EE and Spring Boot.
Guide To Solr in Java With Apache SolrJ
A quick and practical guide on interacting with an Apache Solr server in Java using the Solr4J library.
Introducing nudge4j
A quick tutorial on using nudge4j and your browser to interact with a Java application executing inside the JVM.
Working with Relationships in Spring Data REST
Filed under REST, Spring Data
A practical guide to working with entity relationships in Spring Data REST.
Spring Remoting with Hessian and Burlap
Filed under Spring
A quick, practical guide to implementing RMI in Spring Remoting using Hessian and Burlap.
Introduction to Cobertura
A quick and practical guide to generating code coverage reports with Cobertura.
Upload and Display Excel Files with Spring MVC
Filed under Spring MVC
A quick and practical guide to uploading and displaying Excel files in a Spring MVC application using Apache POI.
Intro to Apache BVal
Filed under Jakarta EE
A quick and practical tutorial on the Apache BVal implementation of the JSR-349 Java Bean Validation specification.
Spring Security – Customize the 403 Forbidden/Access Denied Page
Filed under Spring Security
A quick and focused tutorial on customizing the 403 Forbidden error response page in a Spring Security application.
Two Login Pages with Spring Security
Filed under Spring Security
A quick and practical guide to configuring Spring Security with two separate login pages.
Design a Genetic Algorithm in Java
Filed under Algorithms
A quick and practical guide to designing a basic genetic algorithm in Java.
Working with Microsoft Excel in Java
Filed under Java IO
A quick tutorial on working with Excel files in Java using Apache POI and JExcel.
Building an API With the Spark Java Framework
Filed under REST
A brief tutorial on how to create a web API using Spark Framework for Java.
Apache Maven Tutorial
Filed under Maven
A quick and practical guide to building and managing Java projects using Apache Maven.
MaxUploadSizeExceededException in Spring
Filed under Spring
A brief tutorial on the cause of MaxUploadSizeExceededException in Spring and how to handle it.
Intro to Spring Remoting with HTTP Invokers
Filed under Spring
A quick and practical guide on using the HTTP Invoker in Spring Remoting to invoke remote methods between client and server applications.
Parsing HTML in Java with Jsoup
Filed under Data
A quick and practical guide to parsing HTML in Java with jsoup.
How to Work with Dates in Thymeleaf
Filed under Spring MVC
A quick and practical guide to working with dates in Thymeleaf
Spring Performance Logging
A quick and practical guide to performance monitoring with Spring AOP
Intro to Inversion of Control and Dependency Injection with Spring
Filed under Spring
A quick introduction to the concepts of Inversion of Control and Dependency Injection, followed by a simple demonstration using the Spring Framework
A Guide to Rolling File Appenders
Filed under Logging
A quick and practical guide to using rolling file appenders in popular Java logging libraries
Java – Combine Multiple Collections
Filed under Java Collections
A quick and practical guide to combining multiple collections in Java
Introduction to Spring Integration
Filed under Spring
A quick and practical guide Spring Integration
Geolocation by IP in Java
Filed under Spring MVC
A quick and practical guide to retrieving geolocation data from a public IP address in Java
Custom AccessDecisionVoters in Spring Security
Filed under Spring Security
A quick and practical guide to customizing Spring Security with AccessDecisionVoters
Eliminate Redundancies in RAML with Resource Types and Traits
Filed under REST
In this tutorial, we’ve shown how to significantly reduce or, in some cases, eliminate redundancies from a RAML API definition.
Spring Security – Roles and Privileges
Filed under Spring Security
How to map Roles and Privileges for a Spring Security application: the setup, the authentication and the registration process.
Properties with Spring and Spring Boot
Filed under Spring Boot
Tutorial for how to work with properties files and property values in Spring.