Guide to java.util.GregorianCalendar
1. Introduction In this tutorial, we’re going to take a quick peek at the GregorianCalendar class. 2. GregorianCalendar GregorianCalendar is a concrete implementation of the abstract class...
View ArticleStack Memory and Heap Space in Java
1. Introduction To run an application in an optimal way, JVM divides memory into stack and heap memory. Whenever we declare new variables and objects, call new method, declare a String or perform...
View ArticleRxJava One Observable, Multiple Subscribers
1. Overview The default behavior of multiple subscribers isn’t always desirable. In this article, we’ll cover how to change this behavior and handle multiple subscribers in a proper way. But first,...
View ArticleJava Weekly, Issue 237
Here we go… 1. Spring and Java >> A beginner’s guide to the Hibernate JPQL and Native Query Plan Cache [vladmihalcea.com] A solid introduction to the performance gains to be had through proper...
View ArticleAdd Hours To a Date In Java
1. Overview Before Java 8, java.util.Date was one of the most commonly used classes for representing date-time values in Java. Then Java 8 introduced java.time.LocalDateTime and...
View ArticleIncrement Date in Java
1. Overview In this tutorial, we’ll look at ways to increment date by one day using Java. Before Java 8, the standard Java date and time libraries weren’t very user-friendly. Hence, Joda-Time became...
View Article@Component vs @Repository and @Service in Spring
1. Introduction In this quick tutorial, we’re going to learn about the differences between @Component, @Repository, @Service annotations, in the Spring Framework. 2. Spring Annotations In most typical...
View ArticleGuide to Spring 5 WebFlux
1. Overview Spring WebFlux framework is part of Spring 5 and provides reactive programming support for web applications. In this tutorial, we’ll be creating a small reactive REST application using the...
View ArticleSpring Security Login Page with React
1. Overview React is a component-based JavaScript library built by Facebook. With React, we can build complex web applications with ease. In this article, we’re going to make Spring Security work...
View ArticleHandling Errors in Spring WebFlux
1. Overview In this tutorial, we’ll look at various strategies available for handling errors in a Spring WebFlux project while walking through a practical example. We’ll also point out where it might...
View ArticleContainer Configuration in Spring Boot 2
1. Overview In this quick tutorial, we’ll have a look at how to replace the EmbeddedServletContainerCustomizer and ConfigurableEmbeddedServletContainer in Spring Boot 2. These classes were part of...
View ArticleOptimizing Spring Integration Tests
1. Introduction In this article, we’ll have a holistic discussion about integration tests using Spring and how to optimize them. First, we’ll briefly discuss the importance of integration tests and...
View ArticleCopy a List to Another List in Java
1. Overview In this quick tutorial, we’ll show different ways to copy a List to another List and a common error produced in the process. For an introduction to the use of Collections, please refer to...
View ArticleSpring Security Custom AuthenticationFailureHandler
1. Overview In this quick tutorial, we’re going to illustrate how to customize Spring Security’s authentication failures handling in a Spring Boot application. The goal is to authenticate users using...
View ArticleCommon Java Exceptions
1. Introduction This tutorial focuses on some common Java exceptions. We’ll start by discussing what an exception basically is. Later, we’ll discuss different types of checked and unchecked exceptions...
View ArticleIntroduction to Micronaut Framework
1. What is Micronaut Micronaut is a JVM-based framework for building lightweight, modular applications. Developed by OCI, the same company that created Grails, Micronaut is the latest framework...
View ArticleSpring REST and HAL Browser
1. Overview In this tutorial, we’ll be discussing what HAL is and why it’s useful, before introducing the HAL browser. We’ll then use Spring to build a simple REST API with a few interesting endpoints...
View ArticleJava Weekly, Issue 238
Here we go… 1. Spring and Java >> The best way to use SQL functions in JPQL or Criteria API queries with JPA and Hibernate [vladmihalcea.com] If we’re building the JPQL dynamically using...
View ArticleUploading MultipartFile with Spring RestTemplate
1. Overview This quick tutorial focuses on how to upload a multipart file using Spring’s RestTemplate. We’ll see both a single file and multiple files – upload using the RestTemplate. 2. What is an...
View ArticleIdiomatic Logging in Kotlin
1. Introduction In this tutorial, we’ll take a look at a few logging idioms that fit typical Kotlin programming styles. 2. Logging Idioms Logging is a ubiquitous need in programming. While apparently...
View Article