HandlerInterceptors vs. Filters in Spring MVC
1. Overview In this article, we'll compare the Java servlet Filter and the Spring MVC HandlerInterceptor, and when one might be preferable over the other. 2. Filters Filters are part of the webserver...
View ArticleSplit a String in Java and Keep the Delimiters
1. Introduction Programmers often come across algorithms involving splitting strings. In a special scenario, there might be a requirement to split a string based on single or multiple distinct...
View ArticleOverriding Column Definition With @AttributeOverride
1. Overview In this tutorial, we'll show how to use @AttributeOverride to change a column mapping. We'll explain how to use it when extending or embedding an entity, and we'll cover single and...
View ArticleBuild a Trading Bot with Cassandre Spring Boot Starter
1. Overview A trading bot is a computer program that can automatically place orders to a market or exchange without the need for human intervention. In this tutorial, we'll use Cassandre to create a...
View ArticleConverting String to BigDecimal in Java
1. Overview In this tutorial, we'll cover many ways of converting String to BigDecimal in Java. 2. BigDecimal BigDecimal represents an immutable arbitrary-precision signed decimal number. It consists...
View ArticleHow to Implement a Soft Delete with Spring JPA
1. Introduction Physically deleting data from a table is a common requirement when interacting with databases. But sometimes there are business requirements to not permanently delete data from the...
View ArticleHow to Display a Message in Maven
1. Overview Sometimes, we might want to print some extra information during Maven's execution. However, there's no built-in way to output values to the console in the Maven build lifecycles. In this...
View ArticleMultipart Request Handling in Spring
1. Introduction In this tutorial, we'll focus on various mechanisms for sending multipart requests in Spring Boot. Multipart requests consist of sending data of various different types separated by a...
View ArticleJava Weekly, Issue 386
1. Spring and Java >> Exploring ZooKeeper-less Kafka [morling.dev] Meet KIP-500 in action – simplified configuration, better scalability, and less operational overhead by removing the ZooKeeper...
View ArticleJVM Parameters InitialRAMPercentage, MinRAMPercentage, and MaxRAMPercentage
1. Overview In this tutorial, we'll discuss a few JVM parameters we can use to set the RAM percentage of the JVM. Introduced in Java 8, the parameters InitialRAMPercentage, MinRAMPercentage, and...
View ArticleDeserialization Vulnerabilities in Java
1. Overview In this tutorial, we'll explore how an attacker can use deserialization in Java code to exploit a system. We'll start by looking at some different approaches an attacker might use to...
View ArticleAliasFor Annotation in Spring
1. Overview In this tutorial, we'll learn about the @AliasFor annotation in Spring. First, we'll see examples from within the framework where it's in use. Next, we'll look at a few customized examples....
View ArticleDifference Between Super, Simplest, and Effective POM
1. Overview In this short tutorial, we are going to overview the differences between super, simplest, and effective POM using Maven. 2. What is a POM? POM stands for Project Object Model, and it is the...
View ArticleSpring Conditional Annotations
1. Introduction In this tutorial, we'll take a look at the @Conditional annotation. It's used to indicate whether a given component is eligible for registration based on a defined condition. We'll...
View ArticleIllegalAccessError in Java
1. Overview In this quick tutorial, we'll discuss the java.lang.IllegalAccessError. We'll examine some examples of when it is thrown and how to avoid it. 2. Introduction to IllegalAccessError An...
View ArticleBuild a Dashboard Using Cassandra, Astra, and Stargate
1. Introduction In this article, we are going to build “Tony Stark's Avengers Status Dashboard”, used by The Avengers to monitor the status of the members of the team. This will be built using DataStax...
View ArticleMaximum Size of Java Arrays
1. Overview In this tutorial, we'll look at the maximum size of an array in Java. 2. Max Size A Java program can only allocate an array up to a certain size. It generally depends on the JVM that we're...
View ArticleDownloading Email Attachments in Java
1. Overview In this tutorial, we take a look at how we can download email attachments using Java. For doing so, we need the JavaMail API. The JavaMail API is available as either a Maven dependency or...
View ArticleJava Weekly, Issue 387
1. Spring and Java >> Large Pages and Java [kstefanj.github.io] How to achieve more efficient memory address translation on different OSes in JVM via large pages – short but also quite in-depth....
View ArticleUsing Cucumber with Gradle
1. Introduction Cucumber is a test automation tool that supports Behavior-Driven Development (BDD). It runs specifications written in plain text Gherkin syntax that describes the system behavior. In...
View Article