Extra Login Fields with Spring Security
1. Introduction In this article, we’ll implement a custom authentication scenario with Spring Security by adding an extra field to the standard login form. We’re going to focus on 2 different...
View ArticleA Guide to the finalize Method in Java
1. Overview In this tutorial, we’ll focus on a core aspect of the Java language – the finalize method provided by the root Object class. Simply put, this is called before the garbage collection for a...
View ArticleJava Weekly, Issue 213
Here we go… 1. Spring and Java >> Fumigating the IDEA Ultimate code using dataflow analysis [blog.jetbrains.com] A deep dive into the how code inspection in works in IntelliJ. >> Immutable...
View ArticleHow to Manually Authenticate User with Spring Security
1. Overview In this quick article, we’ll focus on how to programmatically set an authenticated user in Spring Security and Spring MVC. 2. Spring Security Simply put, Spring Security hold the principal...
View ArticleIntoduction to Spliterator in Java
1. Overview The Spliterator interface, introduced in Java 8, can be used for traversing and partitioning sequences. It’s a base utility for Streams, especially parallel ones. In this article, we’ll...
View ArticleGeospatial Support in ElasticSearch
1. Introduction Elasticsearch is best known for its full-text search capabilities but it also features full geospatial support. We can find more about setting up Elasticsearch and getting started in...
View ArticleIntroduction to Lettuce – the Java Redis Client
1. Overview This article is an introduction to Lettuce, a Redis Java client. Redis is an in-memory key-value store that can be used as a database, cache or message broker. Data is added, queried,...
View ArticleIntroduction to Javadoc
1. Overview Good API documentation is one of the many factors contributing to the overall success of a software project. Fortunately, all modern versions of the JDK provide the Javadoc tool – for...
View ArticleHTTP Requests with Kotlin and khttp
1. Introduction The HTTP protocol and APIs built on it are of central importance in programming these days. On the JVM we have several available options, from lower-level to very high-level libraries,...
View ArticleGet Log Output in JSON
1. Introduction Most Java logging libraries today offer different layout options for formatting logs – to accurately fit the needs of each project. In this quick article, we want to format and output...
View ArticleA Simple Tagging Implementation with Elasticsearch
1. Overview Tagging is a common design pattern that allows us to categorize and filter items in our data model. In this article, we’ll implement tagging using Spring and Elasticsearch. We’ll be using...
View ArticleCompiling Java *.class Files with javac
1. Overview This tutorial will introduce the javac tool and describes how to use it to compile Java source files into class files. We’ll get started with a short description of the javac command, then...
View ArticleCustom Assertions with AssertJ
1. Overview In this tutorial, we’ll walk through creating custom AssertJ assertions; the AssertJ’s basics can be found here. Simply put, custom assertions allow creating assertions specific to our own...
View Articlewait and notify() Methods in Java
1. Introduction In this article, we’ll look at one of the most fundamental mechanisms in Java – thread synchronization. We’ll first discuss some essential concurrency-related terms and methodologies....
View ArticleJava Weekly, Issue 215
Here we go… 1. Spring and Java >> Monitor and troubleshoot Java applications and services with Datadog Optimize performance with end-to-end tracing and out-of-the-box support for popular Java...
View ArticleExploring the New HTTP Client in Java 9
1. Introduction In this tutorial, we’ll explore Java 9’s new incubating HttpClient. Until very recently, Java provided only the HttpURLConnection API – which is low-level and isn’t known for being...
View ArticleAsynchronous HTTP with async-http-client in Java
1. Overview AsyncHttpClient (AHC) is a library build on top of Netty, with the purpose of easily executing HTTP requests and processing responses asynchronously. In this article, we’ll present how to...
View ArticleThe Observer Pattern in Java
1. Overview In this article, we’re going to describe the Observer pattern and take a look at a few Java implementation alternatives. 2. What is the Observer Pattern? Observer is a behavioral design...
View ArticleFlyweight Pattern in Java
1. Overview In this article, we’ll take a look at the flyweight design pattern. This pattern is used to reduce the memory footprint. It can also improve performance in applications where object...
View ArticlePriority-based Job Scheduling in Java
1. Introduction In a multi-threaded environment, sometimes we need to schedule tasks based on custom criteria instead of just the creation time. Let’s see how we can achieve this in Java – using a...
View Article