Tips for Creating Efficient Docker Images
1. Overview During the past few years, Docker has become the de facto standard for containerization on Linux. Docker is easy to use and provides lightweight virtualization, making it ideal for building...
View ArticleUsing Hidden Inputs with Spring and Thymeleaf
1. Introduction Thymeleaf is one of the most popular template engines in the Java ecosystem. It allows us to easily use data from our Java applications to create dynamic HTML pages. In this tutorial,...
View ArticleHiding Endpoints From Swagger Documentation in Spring Boot
1. Overview While creating Swagger documentation, we often need to hide endpoints from being exposed to end-users. The most common scenario to do so is when an endpoint is not ready yet. Also, we could...
View ArticleJava Weekly, Issue 349
1. Spring and Java >> Composite Repositories – Extend your Spring Data JPA Repository [thorben-janssen.com] When derived queries come up short: enriching and extending Spring Data JPA...
View ArticleCustom User Attributes with Keycloak
1. Overview Keycloak is a third-party authorization server that manages users of our web or mobile applications. It offers some default attributes, such as first name, last name, and email to be stored...
View ArticleIllegalMonitorStateException in Java
1. Overview In this short tutorial, we'll learn about java.lang.IllegalMonitorStateException. We'll create a simple sender-receiver application that throws this exception. Then, we'll discuss possible...
View ArticleCreating Temporary Directories in Java
1. Overview Temporary directories come in handy when we need to create a set of files that we can later discard. When we create temporary directories, we can delegate to the operating system where to...
View ArticleDates in OpenAPI Files
1. Introduction In this tutorial, we'll see how to declare dates in an OpenAPI file, in this case, implemented with Swagger. This will allow us to manage input and output dates in a standardized way...
View ArticleRolling Back Migrations with Flyway
1. Introduction In this short tutorial, we'll explore a couple of ways to rollback a migration with Flyway. 2. Simulate Rollback with a Migration In this section, we'll rollback our database using a...
View ArticleSSH Connection With Java
1. Introduction SSH, also known as Secure Shell or Secure Socket Shell, is a network protocol that allows one computer to securely connect to another computer over an unsecured network. In this...
View ArticleDifference Between when() and doXxx() Methods in Mockito
1. Introduction Mockito is a popular Java mocking framework. With it, it's simple to create mock objects, configure mock behavior, capture method arguments, and verify interactions with mocks. Now,...
View ArticleGetting Network Information from Docker
1. Overview One of the main features of Docker is creating and isolating networks. In this tutorial, we'll see how to extract information about networks and the containers they hold. 2. Networking in...
View ArticleDAO vs Repository Patterns
1. Overview Often, the implementations of repository and DAO are considered interchangeable, especially in data-centric apps. This creates confusion about their differences. In this article, we'll...
View ArticleKeycloak User Self-Registration
1. Overview We can use Keycloak as a third-party authorization server to manage users of our web or mobile applications. While it's possible for an administrator to add users, Keycloak also has the...
View ArticleJava Weekly, Issue 350
1. Spring and Java >> How to encrypt and decrypt JSON properties with JPA [vladmihalcea.com] Revisit the JPA lifecycle events: encrypting and decrypting JSON properties with JPA >> Creating...
View ArticleHow to Implement Hibernate in an AWS Lambda Function in Java
1. Overview AWS Lambda allows us to create lightweight applications that can be deployed and scaled easily. Though we can use frameworks like Spring Cloud Function, for performance reasons, we usually...
View ArticlePassing Command Line Arguments in Gradle
1. Overview Sometimes, we want to execute various programs from Gradle that require input parameters. In this quick tutorial, we’re going to see how to pass command-line arguments from Gradle. 2. Types...
View ArticleChecking if a Class Exists in Java
1. Overview Checking for the existence of a class could be useful when determining which implementation of an interface to use. This technique is commonly used during older JDBC setups. In this...
View ArticleArrays.asList vs new ArrayList(Arrays.asList())
1. Overview In this short tutorial, we'll take a look at the differences between Arrays.asList(array) and ArrayList(Arrays.asList(array)). 2. Arrays.asList Let's start with the Arrays.asList method....
View ArticleSocial Login with Spring Security in a Jersey Application
1. Overview Security is a first-class citizen in the Spring ecosystem. Therefore, it's not surprising that OAuth2 can work with Spring Web MVC with almost no configuration. However, a native Spring...
View Article