Guide to Creating and Running a Jar File in Java
1. Overview Usually, it’s convenient to bundle many Java class files into a single archive file. In this tutorial, we’re going to cover the ins and outs of working with jar – or Java ARchive – files in...
View ArticleJava Weekly, Issue 267
Here we go… 1. Spring and Java >> The Complete Guide to the Java SE 12 Extended Switch Statement/Expression [infoq.com] A comprehensive write-up on the new syntax and semantics of the switch...
View ArticleAn Introduction to ZGC: A Scalable and Experimental Low-Latency JVM Garbage...
1. Introduction Today, it’s not uncommon for applications to serve thousands or even millions of users concurrently. Such applications need enormous amounts of memory. However, managing all that memory...
View ArticleReading a File in Groovy
1. Overview In this quick tutorial, we’ll explore different ways of reading a file in Groovy. Groovy provides convenient ways to handle files. We’ll concentrate on the File class which has some helper...
View ArticleFiltering Jackson JSON Output Based on Spring Security Role
1. Overview In this quick tutorial, we’ll show how to filter JSON serialization output depending on a user role defined in Spring Security. 2. Why Do We Need To Filter? Let’s consider a simple yet...
View ArticleDefining a Char Stack in Java
1. Overview In this tutorial, we’ll discuss how to create a char stack in Java. We’ll first see how we can do this by using the Java API, and then we’ll look at some custom implementations. Stack is a...
View ArticleBuilding DSLs in Kotlin
1. Overview In this tutorial, we’ll see how powerful Kotlin language features can be used for building type-safe DSLs. For our example, we’ll create a simple tool for constructing SQL queries, just big...
View ArticleHandle Security in Zuul, with OAuth2 and JWT
1. Introduction Simply put, a microservice architecture allows us to break up our system and our API into a set of self-contained services, which can be deployed fully independently. While this is...
View ArticleVoid Type in Kotlin
1. Introduction In this tutorial, we’ll learn about Void type in Kotlin and essentially other ways to represent void or nothing in Kotlin. 2. Void vs void – in Java To understand the use of Void in...
View ArticleA Guide to the Problem Spring Web Library
1. Overview In this tutorial, we’re going to explore how to produce application/problem+json responses using the Problem Spring Web library. This library helps us to avoid repetitive tasks related to...
View ArticleHow to Test the @Scheduled Annotation
1. Introduction One of the available annotations in the Spring Framework is @Scheduled. We can use this annotation to execute tasks in a scheduled way. In this tutorial, we’ll explore how to test the...
View ArticleJava Weekly, Issue 268
Here we go… 1. Spring and Java >> Configuring Spring Boot with application.properties file [dolszewski.com] A comprehensive guide, including how to avoid common mistakes made by newbies and...
View ArticleCreating a SOAP Web Service with Spring
1. Overview In this tutorial, we’ll see how to create a SOAP-based web service with Spring Boot Starter Web Services. 2. SOAP Web Services A web service is, in short, a machine-to-machine, platform...
View ArticleHibernate Aggregate Functions
1. Overview Hibernate aggregate functions calculate the final result using the property values of all objects satisfying the given query criteria. Hibernate Query Language (HQL) supports various...
View ArticleFixing 401s with CORS Preflights and Spring Security
1. Overview In this short tutorial, we’re going to learn how to solve the error “Response for preflight has invalid HTTP status code 401”, which can occur in applications that support cross-origin...
View ArticleDetermine If All Elements Are the Same in a Java List
1. Overview In this quick tutorial, we’ll find out how to determine if all the elements in a List are the same. We’ll also look at the time complexity of each solution using Big O notation, giving us...
View ArticleWorking With Maps Using Streams
1. Introduction In this tutorial, we’ll discuss some examples of how to use Java Streams to work with Maps. It’s worth noting that some of these exercises could be solved using a bidirectional Map data...
View ArticleHibernate Query Plan Cache
1. Introduction In this quick tutorial, we’ll explore the query plan cache provided by Hibernate and its impact on performance. 2. Query Plan Cache Every JPQL query or Criteria query is parsed into an...
View ArticleJava Valhalla Project
1. Overview In this tutorial, we’ll look at Project Valhalla – the historical reasons for it, the current state of development and what it brings to the table for the day-to-day Java developer once...
View ArticleCreating a Custom Annotation in Java
1. Introduction Java annotations are a mechanism for adding metadata information to our source code. They are a powerful part of Java, and were added in JDK5. Annotations offer an alternative to the...
View Article