The JVM GC leveling up, the Vary HTTP header and of course, records. A solid week.
Also find me here:
Baeldung Author
baeldung
This is the standard author on the site. Most articles are published by individual authors, with their own profiles, but when multiple people have a strong contribution, we publish collectively here.
Here's what I've written (so far):
Baeldung on Java
- All
- Weekly Review (389)
- Java (295)
- Spring (221)
- Testing (175)
- Core Java (163)
- Spring Boot (153)
- Java String (138)
- REST (113)
- Java Collections (105)
- Persistence (104)
- Java IO (101)
- Spring MVC (99)
- Spring Security (88)
- Data (83)
- Jakarta EE (81)
- NoSQL (78)
- Spring Data (76)
- DevOps (75)
- Java Concurrency (70)
- Algorithms (69)
- Java Map (62)
- Reactive (60)
- Java Dates (60)
- Security (59)
- Maven (52)
- JPA (48)
- HTTP Client-Side (47)
- Java Streams (46)
- Java Numbers (45)
- Java Array (44)
- Series (43)
- JSON (43)
- Spring Cloud (42)
- Spring Web (38)
- Spring Persistence (35)
- JVM (33)
- Jackson (30)
- Architecture (28)
- Gradle (26)
- XML (24)
- Cloud (23)
- Logging (22)
- IDE (20)
- Groovy (17)
- Networking (13)
- Docker (11)
- Web Services (9)
- Java Web (5)
- Artificial Intelligence (4)
- News (1)
Converting short to byte[] in Java
Filed under Java IO, Java Numbers
Learn how to convert a short value to a byte[] array.
Get the Position of Key/Value in LinkedHashMap Using Its Key
Filed under Java Map
Explore different approaches to getting the position of a key value within a LinkedHashMap in Java.
How to Unit Test an ExecutorService Without Using Thread.sleep()
Filed under Java Concurrency, Testing
Learn how to unit test an ExecutorService instance without using the Thread.sleep() method.
Remove All Characters Before a Specific Character in Java
Filed under Java String
Explore several approaches to removing all characters before a specified character in a string.
Print Distinct Characters of a String in Java
Filed under Java String
Explore various approaches to handling and processing unique characters.
Java Weekly, Issue 540
Filed under Weekly Review
Avoiding n+1 queries, Spring AI, JMS, Graal dev kit, and GitHub actions on Raspberry PI!
Create HashMap with Character Count of a String in Java
Filed under Java String
Learn how to create a HashMap with a string’s character count.
Finding the nth Last Occurrence of char in String
Filed under Java String
Explore different methods to find the nth last occurrence of a character within a string using Java.
Java Weekly, Issue 539
Filed under Weekly Review
Jakarta Data, multimodal LLMs, deprecating Dates in Hibernate, vector API, and Agile as a silver bullet (or not).
Convert String to OffsetDateTime
Filed under Java Dates
Learn why converting strings to OffsetDateTime objects is crucial for handling date and time in Java applications.
Compress and Create a Byte Array Using GZip
Filed under Java Array, Java IO
Learn how to get the compressed data in a byte array when using the GZIP file format.
Java Weekly, Issue 538
Filed under Weekly Review
Stream gatherers in Java 23, small additions in Spring, modern Jakarta EE, AOP logging, and Meta patterns!
Print the Default Value When Overriding toString() Method
Filed under Core Java, Java String
Learn about overriding the toString() method and handling the potential null within.
Find the Length of the Longest Symmetric Substring
Filed under Algorithms, Java String
Learn how to handle the symmetric substring expansion methods, taking into account the specific requirements such as input size and computational efficiency.
Pass a Class as a Parameter in Java
Filed under Core Java
Explore scenarios where we may need to pass a class as a parameter, enabling dynamic behavior and flexibility in our code.
Java Weekly, Issue 537
Filed under Weekly Review
Record as DTOs, stream peeking, JUnit 5 parameterized tests, Java 22, and idempotency key!
Statements Before super() in Java
Filed under Core Java
Learn about the sequence of statements within Java constructors, particularly the placement of super() calls.
Opening HTML File Using Java
Filed under Java IO
Whether opting for the simplicity of the Desktop class or the flexibility of ProcessBuilder, Java offers multiple ways to open HTML files programmatically.
Java Weekly, Issue 536
Filed under Weekly Review
News on Java evolving through JEPs and an exploration of the Azure Spring Apps platform from Microsoft (and VMware). A solid week.
Java Weekly, Issue 535
Filed under Weekly Review
Out with the RestTemplate (again), a look back, yes, back, at the just released Java 22 and forward at Java 23. And a solid piece on why we should fight against context-switching.
Java Arrays Tutorial
Filed under Java Array, Series
A collection of tutorials on Java Arrays
Converting UTF-8 to ISO-8859-1 in Java
Filed under Java String
Explore two approaches for converting UTF-8 encoded strings to ISO-8859-1.
Reading a .gz File Line by Line Using GZIPInputStream
Filed under Java IO
Sometimes, we need to read compressed .gz files in Java. Learn to use Java’s built in stream libraries to read from gzip format files.
How to Convert Excel to JSON in Java
Filed under Jackson
Explore two methods for converting Excel files to JSON format in Java: reading and processing Excel data with Apache POI and then converting it to JSON using the JSON and Jackson libraries.
Java Weekly, Issue 534
Filed under Weekly Review
Java 22 is out. Nuff said 🙂
Representation of Integers at a Bit Level in Java
Filed under Core Java
Understanding how Java represents integers can help us with certain mathematical operations. In this article, we look at integer representation and how to use bitwise operations with Java numbers.
Java Weekly, Issue 533
Filed under Weekly Review
Functional calling LLMs with Java, Ktor new features, postgres indices, GitHub actions on Raspberry PI, and measuring developer productivity. Oh, and JDConf 2024.
Java Dates Tutorial
Filed under Java Dates, Series
Learn about and explore the Java Date and Time API in Java.
Java Weekly, Issue 532
Filed under Weekly Review
Generational ZGC, Java 22 and beyond, random generator, GPU programming in Java, and event interception!
Java Weekly, Issue 531
Filed under Weekly Review
Records meet JPA, cloud cost, and Java at Netflix, more secure APIs, and face-to-face meetings. A packed week.
Find an Unique Email Address in a List
Filed under Java Collections
Explore various techniques for isolating unique email addresses from a Java list.
Find The Largest Number in a String
Filed under Algorithms, Java Numbers, Java String
Explore various ways of properly identifying and extracting the greatest numeric value from a given string in Java.
Java Weekly, Issue 530
Filed under Weekly Review
Optional pattern matching, GC and compilers, GraalVM, minimizing costs, catching up with tech trends, and Postgres tuning!
Mask an Email Address and Phone Number in Java
Filed under Java String, Security
Explore masking of sensitive information for protecting user privacy and adhering to data security regulations.
Java Weekly, Issue 529
Filed under Weekly Review
LINQ emulation in Java, JPA fetch types, stateless sessions in Hibernate, GC improvements, and Actor model concurrency.
Preventing Gson from Expressing Integers as Floats
Filed under Java Numbers, JSON
Learn why integers are considered floating-point numbers and how to prevent Gson from representing integers as floats.
Java Weekly, Issue 528
Filed under Weekly Review
Looking forward to Java 22, Hibernate DAO generation and Jakarta EE development with Payara. A good week.
Looking for a Backend Java/Spring Team Lead with Integration Experience (Remote) (Part Time) – not open
Filed under Spring
Looking for a Java Team Lead with integration experience to join the Baeldung team.
Java Weekly, Issue 527
Filed under Weekly Review
Primitive pattern matching, recursive fetch JPA, soft delete Hibernate, new GraalVM, and life without pull requests. A good week.
Regular Expression for Password Validation in Java
Filed under Java String, Security
Learn how to use a regex for Java-based password validation processes.
Java Weekly, Issue 526
Filed under Weekly Review
CountDownLatch, primitives for pattern matching, eBPF for Java, soft assertions, and 2FA vulnerabilities!
How to Determine if a String Contains Invalid Encoded Characters
Filed under Java String
Learn how to check if a Java string contains invalidly еncodеd characters.
Builder Pattern and Inheritance
Filed under Java
Learn about the challenges in implementing the Builder Design Pattern while dealing with hierarchal inheritance.
Check if Two Date Ranges Overlap
Filed under Java Dates
Explore different scenarios of date range overlap and dive into various approaches and formulas to check for overlaps
Using Current Time as Filename in Java
Filed under Java Dates
In this article, we will learn various approaches to using the current time as a filename in Java.
Introduction to Postman
Explore Postman – a powerful tool for working with APIs.
Printing Message on Console without Using main() Method in Java
Filed under Java
Explore ways of printing messages without the main() method in Java.
Introduction to Apache Calcite
Filed under Data
Learn about Apache Calcite, a powerful data management framework.
Upload Multiple Files Using WebFlux
Filed under Spring Boot
In this article, we learn how to upload multiple files with Spring WebFlux.
Validate if a String Is a Valid Geo Coordinate
Filed under Java String
A short guide on checking if a Java String is a valid Geo Coordinate.
PriorityQueue iterator() Method in Java
Filed under Java Collections
Explore Java’s PriorityQueue iterator() method’s functionality and its effective use in various scenarios.
Using Static Methods Instead of Deprecated JsonParser
Filed under JSON
Learn how to use static methods instead of the deprecated JsonParser for efficient JSON parsing in Java.
Java Weekly, Issue 525
Filed under Weekly Review
New Java features to expect in 2024, testing data access layer, eBPF and Java, and meet Docker Scout
Read Input Character-by-Character in Java
Filed under Java IO, Java Streams
Explore diverse methods in Java for reading characters, covering interactive console input using BufferedReader, file-based character reading with FileReader, and tokenized input handling via Scanner.
Replace Non-Printable Unicode Characters in Java
Filed under Java String
Learn how to replace non-printable unicode characters in Java.
Java Weekly, Issue 524
Filed under Weekly Review
Java persistence patterns, JPA hints, TDD, SemVer in Java, cloud-native Java apps, and refined Java constructors!
Difference Between a Future and a Promise in Java
Filed under Java Concurrency
Explore the differences between Future and Promise, and learn about their key characteristics, use cases, and distinctive features.
Java Weekly, Issue 523
Filed under Weekly Review
GenAI-ying JFR, Quarkus integrated LLMs, Kotlin patterns, secure encryption, and stable diffusion!
Sending Data to a Specific Partition in Kafka
Filed under Data
Learn different techniques for sending data to specific partitions in Kafka.
Java System.currentTimeMillis() Vs. System.nanoTime()
Filed under Java Dates
Explore the differences between Systеm.currеntTimеMillis() and Systеm.nanoTimе().
Java Weekly, Issue 522
Filed under Weekly Review
Upsert with Hibernate, CRaC, Loomed JDBC, sorting in Kotlin, checked exceptions, and lesser-known Apache projects!
Check If a Java StringBuilder Object Contains a Character
Filed under Java String
Explore several approaches to chеck if a Java StringBuildеr objеct contains a specific character.
Comparison of for Loops and Iterators
Filed under Java Collections
Explore a detailed comparison between for loops and iterators, highlighting their key distinctions in several aspects
Calculate Months Between Two Dates in Java
Filed under Java Dates
In this article, we learn how to calculate month intervals between dates in Java.
Read a File and Split It Into Multiple Files in Java
Filed under Java IO
Learn how to split large files into small files by size and the specified number of files.
Comparing One String With Multiple Values in One Expression in Java
Filed under Java String
Discover various ways of finding a string among a group of strings using a single expression.
Java Weekly, Issue 521
Filed under Weekly Review
Stream Gatherers, GC improvements, exceptions in switch, Quarkus virtual threads, lesser-known apache projects, and Software Engineering. A good week.
Convert Excel Files to PDF Using Java
Filed under Java IO
Learn how to convert Excel files to PDF in Java using the Apache POI and iText libraries.
Convert a String to a List of Characters in Java
Filed under Java String
Learn how to convert a string into a list of charactеrs in Java.
Java Weekly, Issue 520
Filed under Weekly Review
Scoped values, auto-closable HttpClient, virtual threads on Helidon 4, DAO or not DAO, and Apache Pinot!
Skip Bytes in InputStream in Java
Filed under Java IO
Learn how to use the skip() method to skip bytеs within a Java InputStrеam.
Static Final Variables in Java
Filed under Core Java
In this tutorial, we learn how to declare and initialize constant variables.
Deserializing JSON to Java Record using Gson
Filed under JSON
Learn how to dеsеrializе JSON data into Java rеcords using Gson.
String’s Maximum Length in Java
Filed under Java String
Explore thе constraints and considеrations rеlatеd to thе maximum lеngth of strings in Java.
Get Index of First Element Matching Boolean Using Java Streams
Filed under Java Collections, Java Streams
Learn how to use the Java Stream API and third-party libraries to find the index of the first element in a List that matches a boolean condition.
How to Effectively Unit Test CompletableFuture
Filed under Java Concurrency, Testing
Learn how to unit test a CompletableFuture using black-box and state-based testing techniques.
Java Weekly, Issue 519
Filed under Weekly Review
Region pinning for G1, Spring meets CDS, class-file API, new features for Java 22, and tech predictions for 2024. Good stuff.
HttpSecurity vs. WebSecurity in Spring Security
Filed under Spring Security
In this tutorial, we learn the difference between HttpSecurity and WebSecurity in Spring.
Rounding Up a Number to Nearest Multiple of 5 in Java
Filed under Java Numbers
Explore multiplе mеthods for rounding up a numbеr to thе nеarеst multiplе of 5 in Java.
Retrieving Unix Time in Java
Filed under Java Dates
In this tutorial, we learn how to retrieve Unix time values in Java.
Working With HarperDB and Java
Filed under NoSQL
Discover Java’s support for HarperDB, a high-performing flexible NoSQL database with the power of SQL.
How to Convert Byte Array to Char Array
Filed under Java Array
Learn how to convert bytе arrays to charactеr arrays in Java while managing various data manipulation tasks.
Java Weekly, Issue 518
Filed under Weekly Review
Unnamed patterns, Spring boot 3.2, generational ZGC, custom JFR events, index selectively, and chopping a monolith
How to Use a Custom Font in Java
Filed under Java
Learn how to use custom fonts in Java applications to еnhancе visual appеal and crеatе distinctivе usеr intеrfacеs.
Convert Long Timestamp to LocalDateTime in Java
Filed under Java Dates
Learn how to convert a Long timеstamp to a LocalDatеTimе objеct in Java.
Passing JVM Options from Gradle bootRun
Explore different ways to pass JVM options to the bootRun command.
Modify Request Body Before Reaching Controller in Spring Boot
Filed under Spring Boot
Learn how to modify an HTTP request before it reaches the controller in a Spring Boot application.
Setup Asynchronous Retry Mechanism in Spring
Filed under Spring Web
Learn to implement an asynchronous execution with automatic retry in a Spring application.
Gradle Proxy Configuration
Filed under Gradle
In this tutorial, we learn how to configure Gradle to work behind a proxy server.
Java Weekly, Issue 517
Filed under Weekly Review
Last few days of Black Friday. Cascading deletes with Hibernate, Spring 6.1, String Templates, Ktor, error handling, and test data generation. A good week 🙂
Asserting Nested Map With JUnit
Filed under Testing
Learn the different ways of asserting the presence of a nested map with JUnit.
How to Parse XML to HashMap in Java
Learn different ways to parse XML into a HashMap, a data structure that allows for efficient data retrieval and manipulation.
Time Complexity of Java Collections Sort in Java
Filed under Java Collections
Explore thе Collеctions.sort() timе complеxity using Java Microbеnchmark Harnеss (JMH).
Convert Timestamp String to Long in Java
Filed under Java Dates
Learn how to convеrt a timеstamp string to a long valuе.
Representing Furthest Possible Date in Java
Filed under Java Dates
Learn how to represent the furthest possible date using the java.util.Date and java.lang.Long classes.
Create Table Using ASCII in a Console in Java
Filed under Java
Learn how to use the Java standard API and a third-party API to create a table using ASCII characters in Java.
Java Weekly, Issue 516
Filed under Weekly Review
Table partitioning with Spring, pattern matching, project loom, generational GC, log4shell retro, and Open Telemetry collector!
Convert ResultSet Into Map
Filed under Java Map, Persistence
Learn to convert a ResultSet in to a HashMap in Java.
HashSet toArray() Method in Java
Filed under Java Collections
Learn how to convert a HashSet into an array using the toArray() method of the HashSet class.
Convert a Hex String to an Integer in Java
Filed under Java Numbers
Explore various approaches to converting a Hex String into an int in Java.
Bill Pugh Singleton Implementation
Filed under Architecture
Learn to implement the Bill Pugh Singleton pattern.
Java Weekly, Issue 515
Filed under Weekly Review
In-memory HTTP server, SSL hot reloading, Kotlin multi-platform, new reactor features, and API versioning!
Convert a Stream into a Map or Multimap in Java
Filed under Java Map, Java Streams
Explore ways of transforming a stream into a Map or Multimap in Java using various approaches and libraries.
Modifying Objects Within Stream While Iterating
Filed under Java Streams
Discover the common mistakes made while modifying the elements in a Java Stream and the correct way to do it.
Round the Date in Java
Filed under Java Dates
Learn how to round the date using the java.util.Date, as well as LocalDateTime and ZonedDateTime.
How to Document Generic Type Parameters in Javadoc
Filed under Java
Explore best practices for using the @param tag to document generic type parameters.
Java Weekly, Issue 514
Filed under Weekly Review
Spring 6.1 is getting closer, and we still have lots of things to explore in Java 21 🙂
Convert String Containing XML to org.w3c.dom.Document
Filed under XML
Learn how to convert a string with XML-based content into Org.w3c.dom.Document in Java.
Convert an XML Object to a String in Java
Filed under Java String, XML
Learn how to convert an XML Document object to a string in Java.
A Guide to Spring 6 JdbcClient API
Filed under Spring Persistence
Learn about the JdbcClient interface, the latest addition to Spring Framework 6.1.
PrintWriter vs. FileWriter in Java
Filed under Java IO
Learned the basic usage of FileWriter and PrintWriter with example code and understand their differences.
Java Weekly, Issue 513
Filed under Weekly Review
Starting to look forward towards Java 22. Good stuff is acoming.
How To Manage Timeout for CompletableFuture
Filed under Java Concurrency
Explore different ways to manage timeouts with Java CompletableFuture.
Remove Elements From a Queue Using Loop
Filed under Java Collections
Learn how to remove elements from a queue using a while loop in Java.
HttpSecurity vs. WebSecurity in Spring Security
Filed under Spring Security
Explore and discover the differences between HttpSecurity and WebSecurity.
Spring Boot 3.1’s ConnectionDetails Abstraction
Filed under Spring Boot
Learn about the ConnectionDetails interface in Spring Boot 3.1.
How to Center Text Output in Java
Filed under Java String
Learn multiple ways to center text output in Java: String formatting, StringBuilder, and StringUtils from the Apache Commons Lang libraries.
How to Write Hashmap to CSV File
Learn how to write HashMap to a CSV file.
Java Weekly, Issue 512
Filed under Weekly Review
Markdown coming to Java comments? Oh, and lots of Kafka 🙂
Split Java String Into Key-Value Pairs
Filed under Java String
A quick and practical guide to splitting Java String into key-value pairs.
Configuring the GlassFish Server in Eclipse
Filed under Java Web
Learn step-by-step how to setup a GlassFish server within the Eclipse IDE.
Using the Apache Commons Lang 3 for Comparing Objects in Java
Filed under Java
Learn to compare objects using Apache Commons Lang 3.
Validate Boolean Type in Spring Boot
Filed under Spring Boot
This tutorial teaches various ways to validate a boolean in Spring Boot.
Difference Between Information Hiding and Encapsulation
Filed under Core Java
Understand the key differences between encapsulation and information hiding.
Convert HashMap.toString() to HashMap in Java
Filed under Java Map
A quick and practical guide to converting HashMap.toString() to HashMap in Java.
Java Weekly, Issue 511
Filed under Weekly Review
Concurrent undo cycle, virtual thread pinning, Kafka worker on virtual threads, Java in Netflix, and no silver bullet in databases. A good week.
Java Weekly, Issue 510
Filed under Weekly Review
Unused variables, pinned threads, class-file API, concurrent undo cycle, strategy pattern, and managerial skills!
Create an ArrayList with Multiple Object Types
Filed under Java Collections
Learn how to create an ArrayList with multiple object types in Java.
Unnamed Patterns and Variables in Java 21
Filed under Core Java
Learn about an exciting preview feature in Java 21: unnamed patterns and variables.
Create a GraalVM Docker Image
Filed under Docker, Spring Boot
Learn how to build a Docker image for a GraalVM native executable.
Increment Character in Java
Filed under Java Streams
Learn how to generate a sequence of characters from ‘A’ to ‘Z’ in Java.
Java Weekly, Issue 509
Filed under Weekly Review
Virtual threads, Java 21, more switch enhancements, GraalOS, JVM stack size, and updating events in EDA!
Code Snippets in Java API Documentation
Filed under Java
Explore how to add code snippets into documentation using the @snippet tag.
Difference Between permitAll() and anonymous() in Spring Security
Filed under Spring Security
Learn about the methods permitAll() and anonymous() of the class HttpSecurity from Spring Security Framework.
Merge Two Arrays and Remove Duplicates in Java
Filed under Java Array
Explore various methods of merging the contents of two arrays and eliminating the duplicates.
How To Convert Excel Data Into List Of Java Objects
Filed under Java Collections, Java IO
Learn about the usage of several libraries, such as Apache POI, Poiji, FastExcel, and JExcelApi, to read and convert data from Excel files into Java objects.
Java Double vs. BigDecimal
Filed under Java Numbers
Compare Java’s Double to BigDecimal and learn about their differences.
Detect EOF in Java
Filed under Java IO
Explore several methods for detecting the end-of-file character in Java.
How to Replace Deprecated jdbcTemplate.queryForObject and jdbcTemplate.query in Spring Boot 2.4.X and above
Filed under Spring Persistence
Laern about the deprecated queryForObject() and query() methods of JdbcTemplate and their preferred counterparts.
Java Weekly, Issue 508
Filed under Weekly Review
Java 21, monkey patching with Java, high-performant records, 12-factor apps, OpenJDK migrations, and real-time applications!
Intro to Gradle Lint Plugin
Filed under Gradle
Learn how to configure the lint plugin and generate lint reports.
Add Minutes to a Time String in Java
Filed under Java Dates, Java String
Learn how to add minutes to a time in the string format using the legacy Date API and the Date Time API.
Query With IN Clause in Spring Data Cassandra
Filed under Spring Data
Learn how to implement the IN query clause using Spring Data Cassandra.
Thymeleaf Guide
Filed under Series, Spring MVC
A collection of tutorials on Thymeleaf
How to Mock Constructors for Unit Testing using Mockito
Filed under Testing
Learn different ways to mock constructors through Mockito and PowerMock.
Constructing Java Objects From Only the Class Name
Filed under Java
Explore the process of creating Java objects using their class names.
Differences Between Heap Dump, Thread Dump and Core Dump
Filed under JVM
Learn the differences between heap dump, thread dump, and core dump and understand their use cases.
Java Weekly, Issue 507
Filed under Weekly Review
Spring Boot with Graal and virtual threads, sealed pattern matching, Oracle JSON, Java 21, and Problem Details in HTTP APIs.
JSON File Data Into Kafka Topic
Filed under JSON
Explore the necessary steps to send JSON format data to the topic using a Kafka producer and consumer.
Java Weekly, Issue 506
Filed under Weekly Review
Spring AI, no more N+1 problem, statement caching, streams with virtual threads, service mesh, and good by EC2 classic!
Aggregate Runtime Exceptions in Java Streams
Filed under Java Streams
Learn about different ways to handle exceptions in Java stream pipelines using aggregation.
Convert Between Java LocalDate and Epoch
Filed under Java Dates
Learn how to convert from Java’s LocalDate to Epoch and vice versa.
Understanding XSLT Processing in Java
Filed under XML
A quick and practical guide to XSLT processing in Java.
Clamp Function in Java
Filed under Java
Learn three different methods to implement the clamp function in Java.
Java Weekly, Issue 505
Filed under Weekly Review
Hiding numerical identifiers in JPA, continuation, Spring Boot file storage, Java 21 migration, and people support strategies!
How to Fix “Error in Opening Zip File” When Running Maven
Filed under Maven
Explore different ways to resolve the “Error in Opening Zip File” issue.
Generate Models Using OpenAPI With Lombok Annotations
Filed under REST
Learn how to generate a model with Lombok annotations using the OpenAPI code generator.
Java Weekly, Issue 504
Filed under Weekly Review
JPA associations, event-driven Java, Valhalla under the hood, OpenJDK compatibility, and millions of connections with Zuul!
Programmatic Generation of JSON Schemas in Java
Filed under Jackson
Learn how to create JSON Schemas programmatically using the Java JSON Schema Generator library.
Executing SQL Script File in Java
Filed under Persistence
Learn about the database utilities provided by MyBatis and Spring JDBC to execute SQL files.
Calculating the Sum of Two Arrays in Java
Filed under Java Array
Learn how to calculate the sum of two arrays element by element in Java.
Sorting Java Map in Descending Order
Filed under Java Map
A quick and practical guide to sorting Java Map in descending order.
Java Validation List Annotations
Filed under Jakarta EE
Explore the utility of the List variant of the annotations available under the package jakarta.validations.constraints.
Conversion From 12-Hour Time to 24-Hour Time in Java
Filed under Java Dates
Learn two different ways to convert time from the 12-hour time format to the 24-hour time format in Java.
Java Weekly, Issue 503
Filed under Weekly Review
The semantic kernel in Java, GC improvements in Java 21, sealed classes, project Leyden, async-profiler, and GenAI code assistance!
HashMap with Multiple Values for the Same Key
Filed under Java Map
A quick and practical guide to HashMap with multiple values per key.
Java Weekly, Issue 502
Filed under Weekly Review
JVM computed constants, safepoints, Maven vs Gradle battle, GC improvements, bulk SQL, and effective technology strategies. A good week.
Introduction to Avaje Inject
Filed under Java
A quick and practical guide to Avaje Inject.
Converting String or String Array to Map in Java
Filed under Java String
A quick and practical guide to converting String or String Array to Map in Java.
Getting Started With Apache Pulsar and Spring Boot
Filed under Spring Boot
Pulsar is a high-throughput pub/sub system which aims to overcome Kafka’s limitations. We look at how to use it with Spring.
Java Weekly, Issue 501
Filed under Weekly Review
Testcontainers, VisualVM profiling, project Leyden, virtual threads, magnificent S3, and GenAI!
Understanding the java.net.SocketException Broken Pipe Error
Filed under Java IO
Learn about the Java “java.net.SocketException: “Broken pipe” error, understand the leading cause of the exception, and see how to fix it.
How to Get the Start and End Dates of a Year Using Java
Filed under Java Dates
Learn how to get the start and end dates of a year using the modern Date Time API and the old Calendar and Date classes.
Docker Compose Support in Spring Boot 3
Filed under Docker, Spring Boot
Learn about the new Docker Compose support in Spring Boot 3.1.0.
Java Weekly, Issue 500 :)
Filed under Weekly Review
Soft delete in JPA, Kotlin 1.9, platform teams, sliced onion architecture, and stream processing!
Law of Demeter in Java
Filed under Java
Learn about the Law of Demeter and understand how to adhere to it in object-oriented code.
Check if a String Has All Unique Characters in Java
Filed under Java String
A quick and practical guide to checking if a String has all unique characters in Java.
Converting JsonNode Object to Map
A quick and practical guide to converting JsonNode to Map in Java.
Difference between Gson @Expose and @SerializedName
Filed under JSON
A quick and practical comparison between Gson @Expose and @SerializedName
Difference Between Map.clear() and Instantiating a New Map
Filed under Java Map
A quick and practical comparison between Map.clear() and creating a new Map.
What Is the Maximum Depth of the Java Call Stack?
Learn how to determine the maximum depth of the Java call stack.
Java Weekly, Issue 499
Filed under Weekly Review
Azure Spring, Spring Rest Client, Micronaut 4, Reactive database connectivity, virtual threads, and Gen-AI.
Does Java Read Integers in Little Endian or Big Endian?
Filed under Java Numbers
Understand the specifics of how Java reads integers and whether it follows the Little or Big Endian approach.
Java Weekly, Issue 498
Filed under Weekly Review
Generational ZGC, reactive database access, health check, Kotlin 1.9, and billions of messages over TCP/IP!
How to Deep Copy an ArrayList in Java
Filed under Java Collections
A quick and practical guide to deep-copying an ArrayList in Java.
Accessing Session Attributes in Thymeleaf
Filed under Spring MVC
A quick and practical guide to accessing session attributes in Thymeleaf.
Integer.class vs Integer.TYPE vs int.class
Filed under Java Numbers
Explore the differences between Integer.class, Integer.TYPE, and int.class. Understand their significance in Java programming.
Check if a String Contains Non-Alphanumeric Characters
Filed under Java String
A quick and practical guide to checking if a String contains non-alphanumeric characters.
Documenting Spring Event-Driven API Using AsyncAPI and Springwolf
Filed under Spring Boot
Learn how to document event-driven Spring Boot services using Springwolf.
Setup Http Patch Request With OpenFeign
Filed under Spring Cloud
Spring Cloud OpenFeign makes it easy to write a client to REST APIs. We can use this for PATCH requests. We look at how this works and how to set it up to avoid common pitfalls.
How to Solve 403 Error in Spring Boot POST Request
Filed under REST, Spring Boot
Learn how to solve the 403 error in a Spring Boot POST request.
Difference Between @JoinColumn and @PrimaryKeyJoinColumn in JPA
Filed under JPA
Learn the difference between @JoinColumn and @PrimaryKeyJoinColumn in Java Persistence API (JPA).
Java Weekly, Issue 497
Filed under Weekly Review
Intermediate stream, intelligent Spring with OpenAI, pattern matching, p99 of GC, and moving out of the Cloud.
Swagger @Parameter vs @Schema
Filed under REST
Let’s compare Swagger’s @Parameter and @Schema annotations, and identify the correct usage for each.
How to Convert application.properties to application.yml for Spring Boot
Filed under Spring Boot
Explore the difference between .properties and .yml files and learn how to convert the application.properties file to application.yml and vice-versa using various tools and plugins.
Java Weekly, Issue 496
Filed under Weekly Review
TODO
JAXP vs JAXB: XML Processing APIs Compared
Filed under XML
Learn the differences between JAXP and JAXB in Java and understand when to use which.
Removing JSON Elements With Jackson
Filed under Jackson
Explore how to remove JSON elements using Jackson and understand the process through practical examples.
Java Weekly, Issue 495
Filed under Weekly Review
Lots and lots of new releases this week. And some Java Records goodness 🙂
Difference Between Boolean.TRUE and true in Java
Filed under Core Java
Explore the differences between Boolean.TRUE and true in Java to properly use these representations of true boolean values.
Hex Representation of a SHA-1 Digest of a String in Java
Filed under Algorithms, Security
Learn three different ways to generate the hex representation of a SHA-1 digest of a string in Java.
Converting a Java List to a Json Array
Filed under Java Collections, JSON
Learn how to convert a Java List to a JSON array.
Java Weekly, Issue 494
Filed under Weekly Review
Simplified SSL in Spring Boot, structured concurrency in Java 21, nulls in Collectors, XSS in Java, and WASM on Docker.
Generating WSDL Stubs With Gradle
Filed under Gradle, Web Services
Learn how to generate WSDL stubs with Gradle and use the generated stub classes.
Combining Two or More Byte Arrays
Filed under Java Array
Explore multiple ways to concatenate two or more byte arrays.
Java Weekly, Issue 493
Filed under Weekly Review
Generational Shenandoah, nullability of value types, class loaders in Java, DDL validation, and rolling out features at scale!
Converting Object To Map in Java
Filed under Java Map
Explore various approaches such as reflection, Jackson, and Gson to convert Java Objects into Java Maps.
How to Display a Full HTTP Response Body With Gatling
Filed under Testing
Learn how to display on the console the full HTTP response body with Gatling.
Java Weekly, Issue 492
Filed under Weekly Review
Exhaustiveness in Pattern Matching, dynamic threads for JVM compilers, JFR events in shell, association attributes in JPA, and zero downtime migrations at scale!
Replacing Variables in a Document Template with Java
Filed under Java IO
Learn how to replace a pattern in various locations of a Word document.
Understanding JPA/Hibernate Associations
Filed under JPA
Learn about the differences between unidirectional and bidirectional associations in JPA/Hibernate.
Spring Boot Properties Prefix Must Be in Canonical Form
Filed under Spring Boot
Learn how to avoid Spring Boot configuration properties errors by using canonical kebab-casing formats.
Java Serialization: readObject() vs. readResolve()
Filed under Core Java
Learn the differences between the readObject() and readResolve() methods of the Java Serialization API.
Configuring Gradle Tasks in Spring Boot 3
Filed under Gradle, Spring Boot
A quick and practical guide to configuring Gradle tasks in Spring Boot 3.
Convert Hashmap to JSON Object in Java
Learn how to convert a Map to JSON in Java.
Array vs. List Performance in Java
Filed under Java Array, Java Collections
Explore the performance of arrays and lists in Java.
Java Weekly, Issue 491
Filed under Weekly Review
Simplified main entries, CDC for cache, cloud-native Graal, key encapsulation, and event sourcing and audit logs!
Generating Javadoc With Gradle
Filed under Gradle
Learn how to generate Javadoc using the Gradle build system.
Object.toString() vs String.valueOf()
Filed under Java String
Discover the differences between the String.valueOf() and Object.toString() methods.
Classpath vs. Modulepath in Java
Filed under Core Java
Explore the distinction between the modulepath and classpath in Java.
Java Weekly, Issue 490
Filed under Weekly Review
Java performance is the theme this week, with a lot of interesting pieces.
Shared Secret Authentication in Spring Boot Application
Filed under Spring Boot, Spring Security
Private microservices may use a shared secret to protect their APIs from illegal access. We look at how to implement a simple token based security pattern based on a shared secret using Spring Security.
Hashing With Argon2 in Java
Filed under Security
Learn about hashing and salting techniques and understand how to hash with Argon2 in Java.
Should We Create an Interface for Only One Implementation?
Filed under Architecture
Explore the practical implications of creating an interface for a single implementation in Java and understand the pros and cons of this approach.
Regular Expression: \z vs \Z Anchors in Java
Filed under Java String
Explore the differences between \z and \Z anchors, how they work, and when to use them.
Difference Between implementation and compile in Gradle
Filed under Gradle
Learn the difference between “implementation” and “compile” in Gradle and provide best practices for effective dependency management
ArrayBlockingQueue vs. LinkedBlockingQueue
Filed under Java Collections, Java Concurrency
Learn about the implementation differences between ArrayBlockingQueue and LinkedBlockingQueue.
Gradle Guide
Learn how to work with Gradle, the build tool for Java-based applications
Java Weekly, Issue 489
Filed under Weekly Review
Unnamed methods in Java, Hibernate 6 migration, async-profiler, generative AI and jobs, and monoliths are not dinosaurs!
Read Multiple Inputs on the Same Line in Java
Filed under Java IO
Learn how to read multiple inputs on the same line using the Scanner class.
Converting an AAR File to a JAR File
Filed under Java
Learn the steps to convert an AAR file to a JAR file.
Difference Between FileReader and BufferedReader in Java
Filed under Java IO
Learn how to use FileReader and BufferedReader and the differences between them.
Lombok EqualsAndHashCode Annotation
Filed under Java
Learn about Lombok’s @EqualsAndHashCode annotation, which generates the equals() and hashCode() methods for a class based on its fields.
Uploading File Using Selenium Webdriver in Java
Filed under Testing
Learn how to upload files using Selenium WebDriver.
Java Weekly, Issue 488
Filed under Weekly Review
Pattern matching and records patterns for Java 21, generational ZGC, Spring transactions, JSON views, low latency queues, and naming!
Find the Index of an Element in a Java Array
Filed under Java Array
Learn various methods for finding the index of an array element using both Java’s built-in APIs and a third-party library.
How to Persist a List of String in JPA?
Filed under JPA
Explore what kind of possibilities there are in JPA to store a list of strings of an entity.
Getting Pixel Array From Image in Java
Filed under Java Array
Learn how to get a two-dimensional array that contains the combined RGB values for every pixel in an image in Java.
Retrieve the Value of an HTML Input in Selenium WebDriver
Filed under Testing
Learn how to set up a Selenium project and retrieve the value of an HTML input field from a web page.
Boolean Converters in Hibernate 6
Filed under Persistence
Learn how to map boolean properties in the domain model using boolean converters added in Hibernate 6.
Java Weekly, Issue 487
Filed under Weekly Review
Java 20, adaptive GC for Quarkus, JFR event streaming, Java threading primitives, maintainable software, and HTTP stats codes!
JAVA_HOME vs PATH Environment Variables
Filed under Java
Explore the differences between using the JAVA_HOME and PATH environment variables.
A Guide to FlexyPool
Filed under Spring Boot, Spring Persistence
Learn learn how to use FlexyPool with Spring Boot and H2 using the HikariCP connection pool.
Overview of NLP Libraries in Java
Filed under Artificial Intelligence
Explore different NLP libraries in Java and see how to implement some NLP tasks using Apache OpenNLP and Stanford CoreNLP.
Execute Tests Based on Active Profile With JUnit 5
Filed under Spring Boot, Testing
Learn how to execute tests based on the active Spring profile using JUnit 5.
Java Weekly, Issue 486
Filed under Weekly Review
Another preview of Foreign Functions, Jakarta REST, Scala 3 annotations, Postgres power features, and Scalable Slack!
Configuring Protobuf Compilation with Custom Source Directories
Filed under Java
Learn how to configure a custom source directory for protobuf files.
Buffer Overflows in Java
Discover what Buffer Overflow is and the threats it poses to our system.
Get All Cached Keys with Caffeine Cache in Spring Boot
Filed under Spring Boot
A quick and practical guide to getting all cached keys in the Caffeine Cache when used with Spring’s Cache.
Parsing Date Strings with Varying Formats
Filed under Java Dates
Explore strategies for parsing multiple date formats at once.
Convert Integer to Hexadecimal in Java
Filed under Java Numbers
Learn how to convert an integer value to hexadecimal in Java.
Reuse StringBuilder for Efficiency
Filed under Java String
Explore the advantages of reusing a StringBuilder and explore a concrete example of how to do it.
Understanding Java’s Classpath vs. Build Path
Filed under Core Java
Learn the difference between the classpath and the build path in Java.
Java Weekly, Issue 485
Filed under Weekly Review
Virtual threads in Java 21, Java profilers, a new build system for Java, auto-explain for Postgres, and Generative AI!
Integrate AWS Secrets Manager in Spring Boot
Filed under Spring Boot
AWS Secrets Manager is a good place to store credentials for databases or other services. We look at how to provide our Spring Boot application with secrets from Secrets Manager at runtime.
Java Helper vs. Utility Classes
Filed under Architecture, Java
Explore the difference between Java helper and utility classes
Hibernate @CreationTimestamp and @UpdateTimestamp
Filed under Persistence
This article explains how to use Hibernate annotations @CreationTimestamp and @UpdateTimestamp to track the creation and update timestamps of an entity in a Java application using the Hibernate framework.
Java Program to Estimate Pi
Filed under Algorithms
Learn how to estimate the value of pi using the Monte Carlo algorithm in Java.
A Guide to Spring Cloud Azure Key Vault
Filed under Security, Spring Cloud
Explore the fundamental principles of cloud-native development and the benefits of using Spring Cloud Azure Key Vault.
Java Weekly, Issue 484
Filed under Weekly Review
Increased GC throughput, writing a profiler from scratch, faster JVM startup, Java 20, and large language models!
Java Weekly, Issue 483
Filed under Weekly Review
Migrating to Hibernate 6, lots of new releases and sending billions of messages per minute, over TCP/IP. A good week 🙂
Difference Between asText() and toString() in JsonNode
Filed under Jackson
Learn about asText() and toString() methods for working with JSON data in Java.
SAML with Spring Boot and Spring Security
Filed under Spring Boot, Spring Security
Learn how to sett up SAML2 with Spring Boot.
Java Weekly, Issue 482
Filed under Weekly Review
Java 20 is out! Nuff said 🙂
Run a Spring Boot Application in AWS Lambda
Filed under Cloud, Spring Boot
AWS has released a library to help convert a Spring Boot application into an AWS Lambda. We look at how to use this library and how to deal with long cold start times.
Change Swagger-UI URL prefix
Filed under Spring Boot
Learn how to change the Swagger-UI URL prefix when using Springfox and how to set up the REST API documentation using OpenAPI 3.0 with redirections.
Java Weekly, Issue 481
Filed under Weekly Review
Java is evolving and growing up. We’re getting close to Java 20 🙂
Configuring Spring Cloud FeignClient URL
Filed under Spring Cloud
Learn different ways of setting up a URL using Spring Cloud FeignClient.
Difference Between Javac and the Eclipse Compiler
Filed under Core Java
A comparison between the Java compiler and the Eclipse compiler.
Java Weekly, Issue 480
Filed under Weekly Review
String Interpolation in Java. Finally. And some profiler limitations.
Introduction to Interface Driven Development (IDD)
Filed under Architecture
Explore the advantages of IDD and an example of how to use it.
Post form-url-encoded Data with Spring Cloud Feign
Filed under Spring Cloud
Learn how to use Feign to make POST API requests with form-url-encoded data in the request body.
Migrate Application From Spring Boot 2 to Spring Boot 3
Filed under Spring Boot
Learn how to migrate a Spring Boot application to Spring Boot 3.
Java Weekly, Issue 479
Filed under Weekly Review
Java security API, Kotlin 2.0 compiler, testcontainers, web apps with Loom, safer refactorings, and write stuff down!
Guide to Java Project Panama
Filed under Java
Project Panama aims to ease the interaction between Java and foreign (non-Java) APIs, i.e., native code written in C, C++, etc.
Download a Webpage in Java
Filed under HTTP Client-Side, Java, Networking
Learn how to download a webpage in Java using Jsoup and HttpURLConnection.
Java Weekly, Issue 478
Filed under Weekly Review
Spring 3 Native support, TSID with Hibernate, window functions in Hibernate, placing features in systems, and Human OS!
Finding All Duplicates in a List in Java
Filed under Java Collections
Learn different ways of extracting duplicate elements from a List in Java.
Introduction to Roaring Bitmap
Filed under Java
Learn about the roaring bitmap data structure, understand some of its operations, and see how it performs compared to BitSet.
Database Keywords as Columns in Hibernate Entities
Filed under Persistence
Learn how to avoid cryptic Hibernate exceptions by properly escaping database keywords in column names.
VarArgs vs Array Input Parameters in Java
Filed under Core Java
A quick and practical comparison between varargs and arrays as input parameters.
Migrate From Java 8 to Java 17
Filed under Java
Explore some extremely useful features available in the newer versions of Java. These features aren’t only easy to learn but can also be implemented quickly without much effort when planning to migrate from Java 8 to Java 17.
javax vs. java Package
Filed under Core Java
Explore examples of both java and javax packages and understand the key differences between them.
Guide to Quarkus Funqy
Filed under DevOps
Learn about Quarkus Funqy as a great addition that helps to run Java functions on the Serverless infrastructure.
Java Weekly, Issue 477
Filed under Weekly Review
Faster Image IO in Java 21, enhanced escape analysis, type-safe stream API queries, scalable media ML, and efficient one-on-ones!
Record vs. Final Class in Java
Filed under Core Java
Explore the differences between records and final classes in Java.
Java Weekly, Issue 476
Filed under Weekly Review
Records in Hibernate, pattern matching, flexible Gradle, Java GC, and Stream Processing with Hazelcas.
Callback Functions in Java
Filed under Core Java
A quick and practical guide to callback functions in Java.
OpenTelemetry Setup in Spring Boot Application
Filed under Spring Boot, Spring Cloud
Deploying microservices can lead to challenges in tracing requests across those services. With OpenTelemetry we’re able to capture logs from independent services and use them to observe traces of entire requests. We look at how to achieve this in Spring.
Java Team Lead with Spring Experience (Remote) (Part Time)
Filed under Java
Looking for a Java Lead with Spring experience to join the Baeldung team.
Guide to HTTPie for Terminal
Filed under HTTP Client-Side
Learn how to install and use the HTTPie CLI tool.
How Do I Generate a Dashboard Report in JMeter?
Filed under Testing
Learn about generating JMeter dashboard reports which are a more useful, efficient, and easy way to analyze data than mere text
Java Weekly, Issue 475
Filed under Weekly Review
Fast Java 21, compact strings, static mocks, native GC for Quarkus, async stack trace, and non-vulnerable microservices!
Determine if a Class Implements an Interface in Java
Filed under Core Java
Learn several ways to determine if an object or a class implements a specific interface.
Generate Unit Test Data in Java Using Instancio
Filed under Testing
Learn how to eliminate manual data setup in tests by auto-generating the data using Instancio.
Java HttpClient – Map JSON Response to Java Class
Learn four ways to map JSON responses to a POJO class when using Java HttpClient.
Structured Concurrency in Java 19
Filed under Core Java, Java Concurrency
Learn about structured concurrency capabilities in Java 19.
Java Weekly, Issue 474
Filed under Weekly Review
Safe native memory management with Java, scaling DAO layer in Spring apps, releasing to maven central, REST glory, and window functions in MySQL!
Ahead of Time Optimizations in Spring 6
Filed under Spring Boot
What’s the concept of AOT and how is applied in Spring 6 looking at pros and cons.
Introduction to ScyllaDB with Java
Filed under NoSQL
Explore ScyllaDB.
Converting a Number from One Base to Another in Java
Filed under Java Numbers
Learn how to convert numbers from one base to another in Java.
Differences Between Spring Data JPA findFirst() and findTop()
Filed under Spring Data
Learn about the findFirst() and findTop() methods from Spring Data JPA.
Batch Processing of Stream Data in Java
Filed under Java Streams
Explore how to accomplish batch processing of Stream data in Java using both native features and some third-party libraries.
Lambda Expression vs. Anonymous Inner Class
Filed under Core Java
A quick and practical comparison between lambda expressions and anonymous inner classes.
Java Weekly, Issue 473
Filed under Weekly Review
Kotlin 1.8, infinite memory with Java 20, DTO projections with Blaze persistence, API design patterns, and functional classes.
Java Weekly, Issue 472
Filed under Weekly Review
Project Panama update, Spring Boot CLI, GraalVM, Jakarta MVC, YugabyteDB pooling, and software maintenance!
Implementing Retry in Kafka Consumer
Filed under Spring
Learn how to implement retry logic on a Kafka topic, including blocking and non-blocking approaches.
Class Methods vs Instance Methods in Java
Filed under Core Java
A brief comparison between class and instance methods in Java.
Lightweight Logging With tinylog 2
Filed under Logging
Learn the fundamental logging methods and configuration parameters of the tinylog 2 logging framework and understand how to issue log entries.
Record Patterns in Java 19
Filed under Core Java
Learn how record patterns allow us to extract the values of a record into variables using pattern matching.
Java Weekly, Issue 471
Filed under Weekly Review
MongoDB, Spring Modulith, liveness and startup probes for Spring Boot, Kafka on K8S, JVM debugging internals, and BigTable pagination in Java. Happy New Year 🙂
Working With Multiple Repositories in Gradle
Filed under Gradle
Learn how to use libraries from multiple repositories when working on a Gradle project and how to use GitHub Package Registry for authenticated repositories.
NonUniqueResultException in Spring Data JPA
Filed under Spring Data
Learn about the NonUniqueResultException in Spring Data JPA and discover strategies to avoid it.
Using Watermarks with iText in Java
Filed under Java IO
Learn how to add watermarks to generated PDF and to an existing PDF using iText.
Java Weekly, Issue 470
Filed under Weekly Review
Pattern matching, GraalVM into OpenJDK, transactional MDC, event sourcing, and Postgres as a Message Queue!
Java Weekly, Issue 469
Filed under Weekly Review
GraalVM in OpenJDK, entity listeners, MicroProfile 6.0, RabbitMQ vs Kafka, and data pipelines at scale!
Getting a Value in JSONObject
Filed under JSON
A quick and practical guide to getting a value from JSONObject.
Reading and Writing With a ConcurrentHashMap
Filed under Java Map
A quick and practical guide to reading and writing from a hash table data structure in a thread-safe way using the ConcurrentHashMap class.
When to Use Callable and Supplier in Java
Filed under Core Java
Learn the differences between Callable and Supplier interfaces and understand when to use them.
Extract Values using AssertJ in Java
Filed under Testing
Learn two ways to extract an object’s value to be asserted on.
Java Weekly, Issue 468
Filed under Weekly Review
JMS enhancements, JakartaEE Serverless, revisiting DTO, Golang impressions, and new a K8S release!
Convert Between int and char in Java
Filed under Core Java
Learn how characters are internally represented in Java and how we can convert an int to a char and back.
Running Multiple Thread Groups in JMeter
Filed under Java Concurrency, Testing
A Thread Group allows us to simulate a specific type of workflow. We can run Thread Groups in parallel, or sequentially. We look at how to achieve this in JMeter.
Set the Date Format Using Apache POI
Filed under Java IO
A quick and practical guide to configuring date format with Apache Poi.
Functors in Java
Filed under Java
Learn what is a Java Functor.
Handle Browser Tabs With Selenium
Filed under Testing
Learn how we handle browser tabs with Selenium.
Java Weekly, Issue 467
Filed under Weekly Review
Panama improvements, fast Java startup in AWS lambda, Spring Boot error handling, TSID vs UUID, and dependency inversion!
A Guide to Spring CredHub
Filed under Spring
Learn how to integrate CredHub with Spring Boot using the Spring CredHub library.
Errors and Exceptions in Java
Filed under Core Java
Explore the differences between errors and exceptions in the Java ecosystem.
Java Weekly, Issue 466
Filed under Weekly Review
Spring Boot 3, from 1RPS to 26RPS, caching effect, K8S secrets, and unusual stack traces!
String Interpolation in Java
Filed under Java String
Explore the topic of String interpolation in Java.
Difference Between Map.ofEntries() and Map.of()
Filed under Java Map
Take a closer look at these two static factory methods for immutable maps and explain which one is suitable for which purpose.
Choosing the Right Java Collection
Filed under Java Collections
Explore all collection interfaces and collection classes in the Java library.
How to Serialize a Singleton in Java
Filed under Core Java
Learn how to create a serializable singleton class in Java.
Convert Between LocalDateTime and ZonedDateTime
Filed under Java Dates
Learn how to convert an instance of LocalDateTime to ZonedDateTime and vice versa.
Uses for Optional in Java
Filed under Core Java
Understand the purpose of the Optional class and learn how to use it efficiently to design clear and robust APIs.
Java Weekly, Issue 465
Filed under Weekly Review
Spring 6, Quarkus Jakarta EE migration, Kotlin on RaspberryPi, REST API over database schema, and logical replication.
Java Course Team Lead with Spring Experience (Remote) (Part Time) (not open)
Filed under Java
Looking for a Java Lead with Spring experience to join the Baeldung team.
Access HTTPS REST Service Using Spring RestTemplate
Filed under REST, Security, Spring Security
Learn how to consume a REST service secured with HTTPS using Spring’s RestTemplate.
Sort Collection of Objects by Multiple Fields in Java
Filed under Java Collections
Learn different approaches for sorting collections by comparing multiple fields.
Java Weekly, Issue 464
Filed under Weekly Review
Spring 6 is finally out. Boot 3 is coming as well. Definitely a good week 🙂
Retry with Delay in RxJava
Filed under Reactive
A quick and practical guide to retrying with delay in RxJava.
Iterate Through Two ArrayLists Simultaneously
Filed under Java Collections
Java does not provide an explicit way to iterate over two lists at the same time. We look at some techniques and libraries that can help us correlate data between two collections according to index.
Inserting an Object in an ArrayList at a Specific Position
Filed under Java Collections
Learn how to add a new element at a specific position to an ArrayList.
The Factory Design Pattern in Java
Filed under Architecture
Explore the factory design pattern.
Thread vs. Single Thread Executor Service
Filed under Java Concurrency
Learn the difference between a thread and an executor service having a single worker thread.
Spring @EnableMethodSecurity Annotation
Filed under Spring Security
Learn the main features of @EnableMethodSecurity and how it replaces @EnableGlobalMethodSecurity.
Retain Only Digits and Decimal Separator in String
Filed under Java String
Explore four approaches for removing all non-numeric characters from a Java String while keeping the decimal separator.
Kong Ingress Controller with Spring Boot
Filed under DevOps, Docker, Spring Boot
Explore the use of the Kong Ingress Controller to manage access to a Spring Boot application deployed on a K8s cluster.
Java Weekly, Issue 463
Filed under Weekly Review
Java thread deprecations, JPA locking, JVM logging, pattern matching, consistent caching at scale, and event sourcing!
Fixing Selenium WebDriver Executable Path Error
Filed under Testing
Understand what causes the Selenium error “The path to the driver executable must be set by the webdriver.chrome.driver system property” and learn how to fix it.
Generate Unique ObjectId in MongoDB
Filed under NoSQL
A quick and practical guide to generating unique ObjectId in MongoDB.
How to Check if All Runnables Are Done
Filed under Java Concurrency
Learn how to check if runnable objects are done.
Difference Between Map and MultivaluedMap in Java
Filed under Java Map
Explore the differences between Map and MultivaluedMap.
Java Weekly, Issue 462
Filed under Weekly Review
Java serialization, better VSCode for Java, JFR event streaming, functional programming issues, and standard errors for HTTP APIs.
A Guide to LinkedHashSet in Java
Filed under Java Collections
Explore the LinkedHashSet data structure from the Java Collections library.
Using Groovy in Spring
Explore the Spring framework’s extensive support for Groovy and learn how to create bean definitions using different approaches.
assertAll() vs Multiple Assertions in JUnit5
Filed under Testing
Normally a single assertion failure will stop a unit test. However, we can group assertions together, and report on their combined success or failure, using assertAll() within JUnit 5.
Java Weekly, Issue 461
Filed under Weekly Review
Java 19 improvements for collections and a new incarnation of switch in Java. Also, Spring Boot 3 and Spring 6 are even closer.
TLS Setup in MySQL and Spring Boot Application
Filed under Spring Security
Learn how to enable a secure connection on a MySQL server.
Implementing Factory Pattern With Generics in Java
Filed under Java
Learn how to implement and use the factory pattern in Java.
Java Weekly, Issue 460
Filed under Weekly Review
Less footprint with Project Leyden, observability in Spring Boot 3, Hibernate 6 migration, high-performance java serialization, and logical replication!
Coupling in Java
Filed under Core Java
Explore coupling in Java.
Kotlin/Spring Developer to help with brainstorming topics for a site (Remote) (Part Time)
Filed under Java
Kotlin Topic Developer
Java Weekly, Issue 459
Filed under Weekly Review
Sequenced collections, loom and spring, better Criteria API, Apache InLong, Zally, and API standardization.
Editing Existing PDF Files in Java
Filed under Java IO
Learn how to edit the content of an existing PDF file in Java.
Setting Time-To-Live Value for Caching
Filed under Spring
Learn how to set TTL caching for Spring-based caching.
Java Weekly, Issue 458
Filed under Weekly Review
On using Spring MVC well, an interesting tool to migrate a Spring project to Boot and some testing goodness. A busy week, overall.
Difference Between Flux and Mono
Filed under Reactive
Learn the difference between Flux and Mono of the Reactor Core library.
Using HAProxy as an API Gateway for Routing and Rate Limiting
Filed under DevOps, Networking
Learn how to use HAProxy as an API Gateway for routing and rate limiting.
Writing a List of Strings Into a Text File
Filed under Java Collections
A quick and practical guide to writing a List of Strings into a text file.
A Guide to Variables in Postman
Filed under REST
Learn about variables in Postman.
Set vs List in Java
Filed under Java Collections
Explore the difference between a List and a Set in Java.
Java Weekly, Issue 457
Filed under Weekly Review
Paving the on-ramp – definitely going to help people get started with Java
Validate UUID String in Java
Filed under Java String
Learn how to validate a UUID string by using regular expressions or the static method of the UUID class.
Differences Between Paths.get and Path.of
Filed under Java IO
Learn about the similarities and differences between the methods Paths.get() and Path.of().
Java Scanner Taking a Character Input
Filed under Java IO
Learn how to take char input using the Java Scanner.
Java Weekly, Issue 456
Filed under Weekly Review
Java 19 is here. Nuff said.
Create a BMI Calculator in Java
Filed under Algorithms
Learn how create your own BMI Calculator in Java.
String Concatenation in Java
Filed under Java String
Learn how to concatenate strings in Java.
TriFunction Interface in Java
Filed under Java
Find out how TriFunction interface works for functional programming in Java.
Fixed Size Queue Implementations in Java
Filed under Java Collections
Learn what fixed-size queues Java has to offer and how to create a new implementation.
Java Weekly, Issue 455
Filed under Weekly Review
Loomified Helidon, no object allocations, extent-local vars, Java 19/20, Postgres-compatible distributed database, and request waiting list.
Convert between JSON and Protobuf
Filed under JSON
Learn how to convert JSON to protobuf and vice versa.
Java Weekly, Issue 454
Filed under Weekly Review
JIT internals, project Loom, DTO/entity mapping, micro-batching, monolith to microservices, and object storage in K8S!
Guide to Find the Java .class Version
Filed under JVM
Learn how to find the Java release version for .class and jar files.
Java Program to Find the Roots of a Quadratic Equation
Filed under Algorithms
Learn how to find the solutions of a quadratic equation in Java.
Connect to Multiple Databases Using Spring Data MongoDB
Filed under NoSQL, Spring Data
Learn how to create multiple connections with Spring Data MongoDB.
Java Weekly, Issue 453
Filed under Weekly Review
Collections performance, null key/values, CORS, state of JVM languages, tornadoVM, and key-range partitioning!
Feign Client Exception Handling
Filed under Spring Cloud
We’ll demonstrate how to handle exceptions in Feign in a Spring Boot project.
Java Weekly, Issue 452
Filed under Weekly Review
All about the G1 collector this week. Oh, and Java 19 is close – less than a month away. Good summer 🙂
Swagger: Specify Two Responses with the Same Response Code
Filed under Spring Web
Learn how to write an API specification that returns two different objects for the same response code using Java and Swagger.
Spring JDBC Batch Inserts
Filed under Spring Persistence
How batch operation can increased insert performance.
Debugging an Application Running in Docker With IntelliJ IDEA
Filed under Docker
Learn different configuration options we can use to debug a dockerized application in IntelliJ
Java Weekly, Issue 451
Filed under Weekly Review
Java bytecode, extent-local variables, CDC and transactional outbox pattern, test containers, and clock-bound wait in distributed systems!
Integer.toString() vs String.valueOf() in Java
Filed under Java String
Learn about the Integer.toString() and String.valueOf() methods.
Propagating Exceptions With OpenFeign and Spring
Filed under Spring Boot
Let’s look at a few strategies for handling errors received during OpenFeign requests.
Sending SOAP Request via Postman
Filed under Web Services
Discover how to set up and call SOAP services through Postman.
Java Weekly, Issue 450
Filed under Weekly Review
Serial GC, MySQL batching, GraalVM update, sequenced collections, services in K8S, open APIs, and K8S 1.25!
Get the Number of Messages in an Apache Kafka Topic
Filed under Data
Learn a few techniques for getting the number of messages in a Kafka topic.
Dockerizing a Java Application
Filed under Docker
A quick and practical guide to dockerizing a Java application.
Java Weekly, Issue 449
Filed under Weekly Review
Parallel GC, DB sequences for Spring Data JDBC, multitenancy with Hibernate, feature flags, and durability in message queues!
Get the Current Stack Trace in Java
Filed under Java
Learn how to get a stack trace using the Thread and Throwable classes
Spring Boot 3 and Spring Framework 6.0 – What’s New
Filed under Spring Boot
Learn about new features that come with Spring Boot 3 and Spring 6.
Using Environment Variables in Spring Boot’s Properties Files
Filed under Spring Boot
Learn how to use environment variables in Spring Boot’s application.properties.
Scanning Java Annotations at Runtime
Filed under Java
Learn about scanning Java annotations at runtime.
Spring Security: Upgrading the Deprecated WebSecurityConfigurerAdapter
Filed under Spring Security
Learn how to create a Spring Security configuration without using WebSecurityConfigureAdapter
Static vs. Instance Initializer Block in Java
Filed under Core Java
A short article explaining the differences between static and instance instantiation.
Filter Java Stream to 1 and Only 1 Element
Filed under Java Streams
Learn two methods from Collectors to retrieve the unique element which matches a certain predicate in a given stream of elements.
Java Weekly, Issue 448
Filed under Weekly Review
Storing monetary values, GraalVM enhancements, project Amber, backend for frontends, and predicting OOMs!
Apply Default Global SecurityScheme in springdoc-openapi
Filed under Spring
Learn how to use springdoc-openapi to define a default global security scheme and apply it as the default security requirement of the API.
Why Maven Doesn’t Find JUnit Tests to Run
Filed under Maven
A practical guide to solving Maven test running issues.
Java Weekly, Issue 447
Filed under Weekly Review
Hibernate UUIDs, Kotlin coroutines, max database connections, K8S native Java, and advocate vs educator!
A Guide to Java Source and Target Options
Filed under Java
Learn how the -source and -target options work in Java 8 and how they’ve evolved from Java 9 onwards
Validate an XML File Against an XSD File
Filed under XML
Learn how to validate an XML file against an XSD file.
Spring Boot – Keycloak Integration Testing with Testcontainers
Filed under Spring Security
A step by step guide to test the authentication of a Spring Boot app using Keycloak
Java Weekly, Issue 446
Filed under Weekly Review
Type inference in Java, JShell, GraalVM on build pipelines, tracing Spring apps, secure API gateway, and cloud-native GitOps!
Advantages and Disadvantages of Using Java Wildcard Imports
Filed under Core Java
Learn the advantages and disadvantages of using wildcard import statements in Java.
Clearing a StringBuilder or StringBuffer
Filed under Java String
Learn how to clear a StringBuilder or StringBuffer in Java.
Guide to Creating Jar Executables and Windows Executables from Java
Filed under Java
Learn how to package a Java program into a Jar and make them executable in Windows.
Instantiating Multiple Beans of the Same Class with Spring Annotations
Filed under Spring
Learn three different approaches for instantiating multiple beans of the same class using Spring annotations.
Java Weekly, Issue 445
Filed under Weekly Review
The cost of logging, becoming an open-source committer, and a quick piece about why HTTP3 is fast. A quick and to-the-point week 🙂
UUID as Entity ID in MongoDB
Filed under Spring Data
Learn to use a UUID as an entity ID in MongoDB.
Difference Between form-data, x-www-form-urlencoded and raw in Postman
Filed under Web Services
Learn the difference between form-data, raw and x-www-form-urlencoded request body types in Postman.
How to Convert InputStream to Base64 String
Filed under Java IO, Java String
Learn how to use Java Streaming IO functions and the built-in Base64 class to load binary data as an InputStream and then convert it to a String.
Java Weekly, Issue 444
Filed under Weekly Review
Stateless sessions in Hibernate, calling native variadic functions, fetching collections in JPA, project Leyden, and hard stuff in computer science!
JavaScript Function Call with Thymeleaf
Filed under Spring MVC
Learn how to call JavaScript functions in a Thymeleaf template.
Java Weekly, Issue 443
Filed under Weekly Review
G1GC, data-oriented programming with project amber, Spring transactions, automated testing, and diversity of browser engines!
Creating JAR Files Programmatically
Filed under Java
Learn how to create and add files to a JAR programatically.
Difference Between Flux.create and Flux.generate
Filed under Reactive
Understand the generate() and create() methods of the Flux API.
Handle Spring Security Exceptions With @ExceptionHandler
Filed under Spring Security
Learn to handle Spring Security Exceptions with @ExceptionHandler.
What Are the Spring Boot Default Memory Settings?
Filed under Spring Boot
Learn about the default values of various heap and stack memory configuration options available for Java applications.
Java Weekly, Issue 442
Filed under Weekly Review
JFR improvements, less footprint for Java, hibernate additions to Criteria API, the Flexcoin race condition, and product backlog.
Difference Between parseInt() and valueOf() in Java
Filed under Java Numbers
Learn the differences between the parseInt() and valueOf() methods of the java.lang.Integer class in Java.
Unit Test Private Methods in Java
Filed under Testing
Why it’s not a good idea to test a private method and how to do it if it’s extremely necessary.
Java Weekly, Issue 441
Filed under Weekly Review
Java GCs, Project Panama, Spring Data JDBC, multiset vs joins, structured concurrency, and HTTP/3.
Disabling Keycloak Security in Spring Boot
Filed under Spring Security
Learn how to disable the configuration put in place by the Spring Keycloak starter.
How to Mock HttpServletRequest
Learn multiple ways to mock a HttpServletRequest object when unit testing Servlet code in Java.
Java “int/char Cannot Be Dereferenced” Error
Filed under Java
Take a closer look at the Java error “int cannot be dereferenced”, learn the leading cause of the exception, and see how to fix it.
Expose GraphQL Field with Different Name
Filed under Web Services
Learn how a GraphQL field can be exposed with a different name.
Java Weekly, Issue 440
Filed under Weekly Review
Java 9 cleaners, structured concurrency in Java 19, definitely non-nullable types in Kotlin, native Java, and maxUnavailable for StatefulSets.
Sorting Objects in a List by Date
Filed under Java Dates
Learn how to sort a Java Collection by Date object in both ascending and descending modes.
Difference Between Thread’s Context Class Loader and Normal Class Loader
Filed under Core Java
Explore the difference in the behavior of current and thread class loaders in Java.
How to Play Sound With Java
Filed under Java
Learn how to play sound two ways using the Java Sound API
Setting Request Headers Using Feign
Filed under REST
OpenFeign is a library that helps us build clients to web services by expressing the contract in a Java interface. We look at how to include header values in our requests through the interface, with fixed and dynamic values, and how to handle cross-cutting concerns like authorization by using interceptors.
Java Weekly, Issue 439
Filed under Weekly Review
Static images for Java, C2 visualization, gazillion threads, Spring Boot 3.0, Java 9 cleaners, and oversized data in Postgres.
RequestLine with Feign Client
Filed under REST
Learn how to use @RequestLine annotation in Feign client.
Java Weekly, Issue 438
Filed under Weekly Review
Structured Concurrency, destructing patterns for Records, a JVM crash story, gRPC probes, and index scans in Postgres!
Find Files That Match Wildcard Strings in Java
Filed under Java IO
Learn how to search for files using wildcard patterns in Java
Apache ActiveMQ vs. Kafka
Filed under Architecture
A comparison between Apache ActiveMQ and Kafka.
Java Scanner useDelimiter with Examples
Filed under Java IO
Learn how to use the useDelimiter method of the Scanner class.
Converting a JDBC ResultSet to JSON in Java
Filed under Persistence
Learn three different ways to convert a JDBC ResultSet to a JSON object.
Reverse a Number in Java
Filed under Java Numbers
Learn how to reverse a number using a mathematical approach in Java.
Java Weekly, Issue 437
Filed under Weekly Review
Hunting down a JVM crash, loom first-take, reactive architectures, more of Hibernate 6, new Transaction API in Quarkus and public-key cryptography.
JPA and Hibernate – Criteria vs. JPQL vs. HQL Query
Filed under JPA
A comparison between Criteria Query, JPQL, and HQL Query.
Java Weekly, Issue 436
Filed under Weekly Review
Project loom in Java 19, ZGC in Java 18, empty finalize, cloud-native Micronaut, symmetric cryptography, and K8S 1.24.
Swap Two Variables in Java
Filed under Algorithms
Learn how to swap two variables in Java, depending on the type of the variables.
Compile Multiple Java Source Files Using the Command Line
Filed under Java
We can use the javac tool to compile source files in Java. We look at how to use it for multiple source files and how to control which libraries are included and where the compiled code will be written.
Finding All Beans with a Custom Annotation
Filed under Spring
A quick and practical guide to finding all custom-annotated beans in Spring.
Error Handling in GraphQL With Spring Boot
Filed under Spring
A practical guide to GraphQL error handling with Spring Boot.
Java Weekly, Issue 435
Filed under Weekly Review
Pattern matching 3rd preview, list in Hibernate 6, custom JFR events, splitting tests in Gradle, and chopping the monolith!
Gradle Build Cache Basics
Filed under Gradle
Local and remote Gradle build cache and how to clear them.
Illegal Character Compilation Error
Filed under Java
Learn about the Illegal Character Compilation Error and how to avoid it.
Looking for a Backend Java/Spring Developer with Integration Experience (Remote) (Part Time) not open
Filed under Spring
Looking for a Java Dev with integration experience to join the Baeldung team.
Spring Tutorial
A collection of tutorials on Spring
Return Map from GraphQL
Filed under Web Services
Learn three different techniques to return a Map object from a GraphQL query.
Java Weekly, Issue 434
Filed under Weekly Review
Native Java on K8S, switch expressions, cloud-native with Quarkus, Hibernate SQM, and ML pipelines at scale!
How to Store HashMap<String, ArrayList> Inside a List
Filed under Java Map
Learn about storing HashMaps inside a List in Java.
Creating a Java Array from Regular Expression Matches
Filed under Java Array
Learn to look for patterns in a string of text in Java.
Checking Connection to MongoDB
Filed under NoSQL
Learn how to check the connection of the MongoDB server with different real-time cases.
Java HttpClient Basic Authentication
Filed under HTTP Client-Side
Learn how to configure the Java HttpClient for basic authentication and how it works.
Spring Boot Configuration Properties Migrator
Filed under Spring Boot
Explore a support system provided by Spring to facilitate Spring Boot upgrades
List vs. ArrayList in Java
Filed under Java Collections
When using collections in Java it’s conventional to use the interface types for our variables and fields, rather than the concrete types. We look at the difference between these two approaches.
Implements vs. Extends in Java
Filed under Core Java
A quick and practical comparison between the implements and extends keywords in Java.
Java Weekly, Issue 433
Filed under Weekly Review
Testcontainers, Project Panama, zoned date-times in Hibernate 6, Spring RCE, CRDTs, and changes in K8S 1.24!
Liquibase vs Flyway
Filed under Persistence
Comparison between Liquibase and Flyway.
Return Only Specific Fields for a Query in Spring Data MongoDB
Filed under NoSQL, Spring Data
Learn how to use projections in Spring Data MongoDB to restrict the fields that are returned from a query
Hide a Request Field in Swagger API
Filed under REST
A quick and practical guide to hiding a request field in Swagger UI.
BootstrapMode for JPA Repositories
Filed under JPA
Learn the different types of BootstrapMode for JPA repositories.
A Guide to JPA Buddy
Filed under JPA
Explore JPA Buddy and its main features and see how we can use them during the application development cycle.
Common Command-Line Compile Errors in Java
Filed under Java
Learn about some common command-line compile errors in Java.
Java Weekly, Issue 432
Filed under Weekly Review
Spring RCE, JavaDoc Snippets, native Java, update on Project Loom, value classes, and automated tests!
Basic Authentication in JMeter
Filed under Testing
We can use JMeter to load test endpoints with Basic Authentication in a few different ways. We look at the simplest method of adding credentials directly to a header, along with how to provide a set of credentials from a data source.
Java Error “variable might not have been initialized”
Filed under Core Java
How to solve “variable might not have been initialized” in Java.
Retrieve a Value from MongoDB by Its Key Name
Filed under NoSQL
Learn how to retrieve the value by key name in MongoDB.
Java Weekly, Issue 431
Filed under Weekly Review
Spring with Java 17 baseline, simple web server, test containers, AOT in Spring 6, ZGC, and the age of APIs!
Bulk Update of Documents in MongoDB
Filed under NoSQL
Learn how to perform bulk operations in MongoDB using different kinds of write operations.
Guide to Upsert in MongoDB
Filed under NoSQL
Learn how to perform upsert operations with various update methods of MongoDB.
Logging MongoDB Queries with Spring Boot
Filed under NoSQL, Spring Boot
Learn how to enable a debug logging level for Spring Data MongoDB
The for-each Loop in Java
Filed under Core Java
Learn all about the the for-each loop in Java – its syntax, benefits and drawbacks, and examples.
Java Weekly, Issue 430
Filed under Weekly Review
Java 18 is here, composite ids in JPA, Java language evolution, security features in Java 18, error handling, and a better hiring process!
Import Data to MongoDB From JSON File Using Java
Filed under NoSQL
Learn how to import data to MongoDB from JSON files
SSO with Apache Tomcat
Learn how to configure SSO with Apache Tomcat.
A Guide to @DBRef in MongoDB
Filed under Spring Data
Learn how to use Spring Data MongoDB’s @DBRef annotation to connect related documents.
Java Weekly, Issue 429
Filed under Weekly Review
Java 18 GC improvements, cooperative thread interruptions, best practices for Java projects, feature flags, and scaling bottleneck.
Push Operations in MongoDB
Filed under NoSQL
Learn how to insert documents into an array in MongoDB.
Difference Between POJO, JavaBeans, DTO and VO
Filed under Java
Learn what Data Transfer Object (DTO), Value Object (VO), Plain Old Java Object (POJO), and JavaBeans are. Understand the differences between them and when to use each type.
Automorphic Numbers in Java
Filed under Java Numbers
Understand what an automorphic number is and learn a couple of approaches in Java to determine if a number is automorphic.
Convert long to int Type in Java
Filed under Java Numbers
A quick and practical guide to long to int conversion in Java.
Using Nginx as a Forward Proxy
Filed under Networking
Learn how to use Nginx as a forward proxy for any requested location.
Push and Set Operations in Same MongoDB Update
Filed under NoSQL
Learn how to apply multiple operations together in a single MongoDB query.
Set List of Objects in Swagger API Response
Filed under REST
Learn how to modify the Swagger API response to deliver a list of objects.
Acquire a Lock by a Key in Java
Filed under Java Concurrency
Learn how we can get a lock on a specific key to prevent concurrent actions on that key without impeding actions on other keys
Authentication With Spring Security and MongoDB
Filed under NoSQL, Spring Security
Learn how to authenticate a user using Spring Security and MongoDB
Java Weekly, Issue 428
Filed under Weekly Review
Reconsidering DTOs, Spring Shell, Cloud CVEs, technical debts, and how we found dirty pipe vulnerability!
Check Collection Existence in MongoDB
Filed under NoSQL
Explore various ways to check the existence of a collection using the MongoDatabase and DB class methods.
Retrieve Original Message From Feign ErrorDecoder
Filed under REST
Learn to retrieve the original message from Feign ErrorDecoder.
Update Documents in MongoDB
Filed under NoSQL
Explore various ways to update the documents in MongoDB.
Does GC Release Back Memory to OS?
Filed under JVM
Learn how Java Garbage Collection works.
Java Weekly, Issue 427
Filed under Weekly Review
It’s all about the future: Java 18 & 19, Hibernate 6 features, Groovy 4, Kotlin 1.6.2, permitted sealed classes, and API evolution.
Update Multiple Fields in a MongoDB Document
Filed under NoSQL
Explore various ways to update multiple fields of a document in MongoDB.
How to Create a New Entry in a Map
Filed under Java Map
Learn how to use Java’s built-in classes, third-party libraries, and a custom implementation to create an Entry object in a Map.
A Guide to Maven Artifact Classifiers
Filed under Maven
Learn about artifact classifiers in Maven and understand the various scenarios where they are useful.
Java Weekly, Issue 426
Filed under Weekly Review
Spring Data 3.0, avoiding stringly typed Kotlin, ID generation in JPA, dockershim removal, and quantum computing.
Check if a User Is Logged-in With Servlets and JSP
Filed under Security
Learn how to use Servlets and JSPs to ensure a user is authenticated and has started a valid session before accessing any resources.
Java Missing Return Statement
Filed under Java
Explore some examples of missing return statements in Java.
Enable Logging for Spring Security
Filed under Logging, Spring Security
Leran how to modify the Spring Security logging level
Producer-Consumer Problem With Example in Java
Filed under Algorithms, Java Concurrency
A quick and practical guide to Producer-Consumer problem in Java.
How to Invert a Map in Java
Filed under Java Map
Learn different options to invert a Map in Java.
GraphQL vs REST
Filed under REST, Web Services
GraphQL and REST can be used to enable the same integrations between different parts of our systems. We compare the two approaches to see how they have benefits in different situations.
Looking for a Java Developer with Spring Experience (Remote) (Part Time) (not open)
Filed under Java
Looking for a Java Dev with Spring experience to join the Baeldung team.
Create an Empty Map in Java
Filed under Java Map
Learn how to create empty maps in Java
Document Enum in Swagger
Filed under Spring Web
Learn how to document enum in Swagger using the Maven plugin and verify the generated JSON document in the Swagger editor.
Spring @Autowired Field Null – Common Causes and Solutions
Filed under Spring
Learn about an error that would cause a NullPointerException when we unintentionally mix Spring injection with objects we create by calling their constructors.
Java Weekly, Issue 425
Filed under Weekly Review
Configurable card tables in Java GCs, Meet System Logger, configuring Spring Boot apps, serializability in practice, and 12-factor apps!
Error: “trustAnchors parameter must be non-empty”
Filed under Security
Learn the reasons for the error: “java.security.InvalidAlgorithmParameterException: trustAnchors parameter must be non-empty” and how to fix it
Configure and Use Multiple DataSources in Spring Boot
Filed under Spring Boot, Spring Persistence
Learn how to configure multiple data sources with Spring Boot.
Java Weekly, Issue 424
Filed under Weekly Review
ForkJoinPool and parallelism, Embeddable in Hibernate 6, Java annotations, AWS in IntelliJ, free K8S cluster, and ML meet BigQuery!
Java ArrayIndexOutOfBoundsException
Filed under Java Array
Learn what causes ArrayIndexOutOfBoundsException in Java and common techniques to avoid it.
Customizing Zuul Exceptions
Filed under Spring Cloud
An example of Zuul filter creation.
Hibernate Validator Annotation Processor in Depth
Filed under Persistence
When using the Java constraints library, it’s easy to make a mistake with an annotation and only find out about it at runtime. We look at the available annotation processor and how it can give us early feedback.
Printing Thread Info in Log File Using Log4j2
Filed under Logging
Learn how to print thread info using Log4j2
Get Current Trace ID in Spring Cloud Sleuth
Filed under Spring Cloud
Learn how to get current trace and span ID in Spring Cloud Sleuth.
Java Weekly, Issue 423
Filed under Weekly Review
From the next version of Maven, through measuring parallelism and all the way to core Agile principles. An interesting week.
An Introduction to Domain Graph Service (DGS) Framework
Filed under Spring Boot
Learn how to use the Domain Graph Service (DGS) Framework from Netflix to build a simple Spring Boot GraphQL service in Java.
Get Last Inserted Document ID in MongoDB With Java Driver
Filed under NoSQL
Learn about MongoDB document IDs and how to retrieve the ID of a document we just inserted in a collection via a Java program.
Javadoc: @see, @link, and @inheritDoc
Filed under Java
A comparison between the @see and @link Javadoc annotations.
Java Weekly, Issue 422
Filed under Weekly Review
GraalVM release, composition vs inheritance in JPA, Gradle plugins, finding performance regressions at scale, and beautiful technical debt.
Change Cell Font Style with Apache POI
Filed under Java IO
Learn how to modify the font style of cells in a Microsoft Excel document
Adding EventHandler to JavaFX Button
Filed under Java
Learn how to add a handler event to a button for a JavaFX interface.
What Is the Difference Between NIO and NIO.2?
Filed under Java IO
Understand Java IO functionalities and how they changed throughout different Java versions.
Testing LDAP Connections With Java
Filed under Security
Learn how to test an LDAP server using a Java client
How to Access EntityManager with Spring Data
Filed under Spring Data
Learn how to access the EntityManager directly when working on a Spring Data application.
Java IdentityHashMap Class and Its Use Cases
Filed under Java Map
Learn how to use IdentityHashMap in Java
Generating a Secure AES Key in Java
Filed under Security
A quick and practical guide to generating a secure AES key in Java.
Java Weekly, Issue 421
Filed under Weekly Review
Revisiting transactional, dynamic, and partial updates, JPA flush modes, Kafka vs Chronicle, and the real cost of attrition!
Cassandra Batch in Cassandra Query Language and Java
Filed under Data
Learn about the Cassandra batch query and how to apply it in Cqlsh and Java using BatchStatement.
Get the Name of the Currently Executing Test in JUnit
Filed under Testing
Sometimes we need our unit tests to be able to access the name JUnit has allocated to them. This is especially useful when using name generators or parameterized tests. We look at how to solve this problem in both JUnit 4 and 5.
Convert a Maven Build to Gradle
Learn how to convert a Maven build to a Gradle build.
Find All Jars Containing Given Class
Filed under Java
In this article, we’ll learn to find all the jars containing a particular class.
Hidden Classes in Java 15
Filed under Core Java
A quick and practical guide to Java 15’s Hidden Classes.
An Introduction to InstantSource in Java 17
Filed under Java Dates
Learn all about the InstantSource interface introduced in Java 17. Understand what problems it addresses, and how to use it.
Java Weekly, Issue 420
Filed under Weekly Review
All about distributed systems: fault tolerant JVM, circuit breaker for RestTemplate, tracing in Spring Boot and replicated log. Also, catching errors in Java and risk of micro-dependencies!
Running a TestNG Project From the Command Line
Filed under Testing
TestNG is a unit testing library which can be run via the IDE and build tooling. We look at how to run TestNG tests directly with the command line.
Generating a Java String of N Repeated Characters
Filed under Java String
Producing a string out of repeating a character or sequence can be done a variety of ways. We look at a few methods, and compare them for readability and efficiency.
SequenceInputStream Class in Java
Filed under Java IO
A quick and practical guide to Java SequenceInputStream class.
Keycloak Integration – OAuth2 and OpenID with Swagger UI
Filed under Security
Learn how to test a REST service that uses Keycloak for authentication and authorization with Swagger UI
Java Weekly, Issue 419
Filed under Weekly Review
Happy New Year 🙂 An interesting set of articles this week, from HTTP to persistence optimization and some Dilbert.
String equals() Vs contentEquals() in Java
Filed under Java String
Learn the differences between the equals() and the contentEquals() methods of the String class in Java using practical examples.
Working with (Unknown Source) Stack Traces in Java
Filed under Java
Learn why we see an unknown source in our Java exception stack trace and how can we fix it.
Multiple Line Code Example in Javadoc Comment
Filed under Java
A quick and practical tutorial to embedding code samples in JavaDoc comments.
Volatile Variables and Thread Safety
Filed under Java Concurrency
Learn why declaring a shared variable as volatile does not always guarantee thread-safety.
Replication Strategies and Partitioning in Cassandra
Filed under NoSQL
A quick and practical overview of replication strategies in Cassandra.
Why Maven Uses a Different JDK
Filed under Maven
Learn why Maven might use a different version of Java than the default one set in the system
Java Weekly, Issue 418
Filed under Weekly Review
State of Valhalla, Quarkus 2.6, Native Spring, new coroutine release, Qodana code quality, and the holy grail of keyboard layouts! A good way to end the year 🙂
Set the Name of a Thread in Java
Filed under Java Concurrency
Learn to set a Thread name in Java.
Numeric Format Using POI
Filed under Java IO
Learn how to format numeric cells in Excel using Apache POI
Is Cassandra a Column-Oriented or Column-Family Database?
Filed under NoSQL
Learn how Cassandra stores data in a partitioned row store and how this differs from a column-oriented data store.
Java Weekly, Issue 417
Filed under Weekly Review
Kotlin extension and delegations, Spring Boot 2.6, custom JPA repositories, open-source dilemma, and microservices vs monoliths!
Guide to JBang
Filed under DevOps
Learn how to create, edit and run self-contained source-only or binary Java programs with ease using JBang.
Remove Duplicate Dependencies with Maven
Filed under Maven
Learn how to detect duplicate dependencies in Maven using the mvn dependency:tree and mvn dependency:analyze-duplicate commands.
Speed up Spring Boot Startup Time
Filed under Spring Boot
Learn different configurations and setups that can help decrease Spring Boot startup time.
Java HTTPS Client Certificate Authentication
Filed under Security
Learn how to use HTTPS Client Certificate Authentication in Java
Java Weekly, Issue 416
Filed under Weekly Review
All about log4j RCE exploit, Spring Boot remedies for log4j, building native images in Quarkus, and a new AWS region in Jakarta.
Check if an Enum Value Exists in Java
Filed under Java
Learn various ways to search enums in Java.
Java Implicit Super Constructor is Undefined Error
Filed under Java
Learn about Java’s “implicit super constructor is undefined” error and how to resolve it
Lombok Using @With Annotations
Filed under Java
Learn how to make copies of immutable objects with changes to only a single property using Lombok.
Generate PDF from Swagger API Documentation
Filed under REST
Learn how to generate a PDF document from an OpenAPI Swagger definition using Maven plugins and the online Swagger To PDF tool.
Java Weekly, Issue 415
Filed under Weekly Review
Migrating to Java 17, i18n in Spring Boot, naming strategies in Hibernate 5, simple web server, and fully-managed load testing on Azure. Good stuff as we’re getting closer to 2022.
Reading Values From Excel in Java
Filed under Java IO
Learn how to access different cell values using Apache POI.
Getting a Bit at a Certain Position from Integral Values
Filed under Java
We may need to test whether the binary digits of a number are set. We explore how to do this for any digit in an integer, using some optimised binary maths as well as some simpler alternatives.
Add an Image to a Cell in an Excel File With Java
Filed under Java IO
Apache POI allows us to build Excel spreadsheets from Java code. In this tutorial we look at the steps for adding images to our spreadsheets.
JMX Ports
Filed under Java
Learn which ports are opened by JMX on startup
Java Weekly, Issue 414
Filed under Weekly Review
Modeling relations in Mongo, Java performance tips, new features in Java, warming caches at Netflix’s scale and reimagining software architecures!
Concatenating Null Strings in Java
Filed under Java String
Learn various approaches to avoid null String objects while concatenating Strings in Java.
415 Unsupported MediaType in Spring Application
Filed under Spring MVC
In this tutorial, we’re going to showcase the causes and resolutions of the HTTP response code 415 Unsupported MediaType for POST requests in a Spring Application.
Quarkus Bean Discovery With Jandex Indexing
Filed under DevOps
In this article, we’ll learn the difference between bean discovery in Quarkus and classic Jakarta EE environments.
Java Weekly, Issue 413
Filed under Weekly Review
Java bridger, GC improvements in Java, Kotlin 1.6, native images, hashing in Java, full-stack Spring Boot, and K8S operators!
Testing NoSQL Queries With Spring Boot and @DataCassandraTest
Filed under Data, Spring Boot
Learn how to test a Cassandra database slice of a Spring Boot application using the Spring @DataCassandraTest annotation.
Importing Maven Project into Eclipse
Filed under Maven
Learn how to import a Maven project into Eclipse.
Get all the Keys in a JSON String Using JsonNode
Filed under Jackson
Learn different ways to read key names from JSON content.
Add Borders to Excel Cells With Apache POI
Filed under Java IO
Explore how to generate a variety of cell borders using CellRangeAddress, RegionUtil, BorderStyles, and IndexedColors classes.
Declaring Val and Var Variables in Lombok
Filed under Java
Learn how to use Lombok’s val and var to define local variables without specifying the type.
Omitting Getter or Setter in Lombok
Filed under Java
Learn how to skip the generation of individual getters and setters when using Lombok annotations.
Java Weekly, Issue 412
Filed under Weekly Review
Large objects and GC in Java 18, new API in project loom, native images for Spring Boot, AWS MemoryDB, and building an startup!
Set Background Color of a Cell with Apache POI
Filed under Java IO
Learn how to change the cell background color in Excel using Apache POI.
Constructors in Java Abstract Classes
Filed under Core Java
A quick and practical guide to using constructors in abstract classes.
Ignoring Commas in Quotes When Splitting a Comma-separated String
Filed under Java String
Learn various approaches for ignoring commas in quotes when splitting a comma-separated String.
Solving Certificate Store Errors in JVM
Filed under JVM
In this tutorial, we’ll take a look at common issues we might encounter when issuing SSL requests.
Spring Webflux and @Cacheable Annotation
In this article, we’ll explain how Spring WebFlux interacts with @Cacheable annotation
Assert That a Java Optional Has a Certain Value
Filed under Testing
We may need to write assertions on Optional values. We explore a few ways to do this, both with JUnit assertions and with the AssertJ library.
What Is OncePerRequestFilter?
Filed under Spring Web
Learn how to use the Spring OncePerRequestFilter to ensure your filter code is executed only once for each request.
Java Weekly, Issue 411
Filed under Weekly Review
Bulk updates in Spring Data JPA, Java HTTP Clients, Hibernate Reactive, feature flags in Spring Boot, and non-root containers in K8S!
Request Routing and Snitches in Cassandra
Filed under NoSQL
Learn about the job of a snitch and how Cassandra uses it to efficiently route requests.
Check if the First Letter of a String Is Uppercase
Filed under Java String
Explore different solutions for checking if the first letter is uppercase.
Nested HashMaps Examples in Java
Filed under Java Map
Learn how to create, compare, update and flatten a nested HashMap.
List All the Classes Loaded in the JVM
Filed under JVM
Learn different techniques to list all classes loaded in the JVM
Initialization Vector for Encryption
Filed under Security
Learn how to use an Initialization Vector (IV) with encryption algorithms and the best practices while using the IV
Split a String Only on the First Occurrence of Delimiter
Filed under Java String
Learn two approaches to split a String only on the first occurrence of a delimiter in Java.
Serialization Validation in Java
Filed under Core Java
Learn about validating serializable objects in Java.
New Features in Java 17
Filed under Core Java
In this article, we’ll talk about the news related to the new version of the Java ecosystem, Java SE 17 – the new features and the changes in its release process, LTS support, and licenses.
Guide to Garbage Collector Roots
Filed under JVM
Learn what GC roots are and their usage in the garbage collection process
Introduction to HexFormat in Java 17
Filed under Java String
Learn how easy it is to convert between bytes and hexadecimal strings with the updated HexFormat class in Java 17.
How to Get Docker-Compose to Always Use the Latest Image
Filed under Docker
In this tutorial, we’ll check out several options to ensure that docker-compose always uses the latest images of the applications.
Java Weekly, Issue 410
Filed under Weekly Review
Finalizer deprecation, string improvements in Java 17, Kotlin support in protocol buffers, cache libraries on JVM, and software engineering principles.
Splitting a Java String by Multiple Delimiters
Filed under Java String
Learn different options for splitting an input string by multiple delimiters using regular expressions, Google Guava, and Apache Commons
What Is the –release Option in the Java 9 Compiler?
Filed under Core Java
Learn about Java 9’s new command-line compiler option –release, what it does and how to use it.
Remove Beginning and Ending Double Quotes from a String
Filed under Java String
Learn different approaches for removing the beginning and ending double quotes from a String in Java.
Java Weekly, Issue 409
Filed under Weekly Review
Hibernate Reactive goes GA, caching, Record serialization, no more Dockerfiles with Paketo, and embracing mob programming!
Multiline Text in Excel Cell Using Apache POI
Filed under Java IO
Learn how to add multiline text to a cell using Apache POI.
Java Map – keySet() vs. entrySet() vs. values() Methods
Filed under Java Map
Learn how to use the keySet(), entrySet() and values() methods of the Map interface in Java.
Java Weekly, Issue 408
Filed under Weekly Review
Serialization filters, cold starts in JVM, faster charset encoding, simple web server, JDBC caching, and specialized kube-proxies!
Parallel Test Execution for JUnit 5
Filed under Testing
In this article, we’ll cover how to execute parallel unit tests using JUnit 5.
Remove Accents and Diacritics From a String in Java
Filed under Java String
This article explains what Unicode text normalization is, how to remove accents and diacritical marks in text, and the pitfalls to watch out for.
Format Swagger Text Descriptions
Filed under REST
A quick and practical guide to formatting Swagger descriptions.
Remove an Entry from a Java HashMap
Filed under Java Map
Learn different ways to remove an entry from a Java HashMap.
Convert a Byte Array to a Numeric Representation in Java
Filed under Java Numbers
Explore different approaches to convert a byte array to a numeric value and vice versa in Java.
Environment Variable Prefixes in Spring Boot 2.5
Filed under Spring Boot
Learn how to use a prefix for environment variables with Spring Boot.
Java Weekly, Issue 407
Filed under Weekly Review
Faster Maven builds (always good), how SREs scale in an org, and a cool Datadog feature. A solid week overall.
Using Fail Assertion in JUnit
Filed under Testing
Explore practical use cases for the fail assertion in JUnit.
Get a Field’s Annotations Using Reflection
Filed under Java
Learn how to get a field’s annotations and how the retention meta-annotation works
Update the Value Associated With a Key in a HashMap
Filed under Java Map
Learn several methods for updating the value associated with a HashMap key using core Java.
Trusting All Certificates in OkHttp
Filed under HTTP Client-Side
Learn how to create an OkHttpClient and configure it to trust all certificates — not the best practice in production, but you may need it from time to time during development or testing.
Cassandra Frozen Keyword
Filed under NoSQL
Learn about the frozen keyword in Apache Cassandra and how to create frozen collections and user-defined types.
Spring Boot vs Quarkus
Filed under Spring
A practical comparison between Spring Boot and Quarkus, with a focus on performance.
Generate a WAR File in Maven
Filed under Maven
In this tutorial, we’re going to consider the usage of the Maven WAR plugin with a Java EE application.
Hibernate’s “Object References an Unsaved Transient Instance” Error
Filed under Persistence
Learn how to define a proper CascadeType to solve the “org.hibernate.TransientObjectException: object references an unsaved transient instance” error
Java Weekly, Issue 406
Filed under Weekly Review
ZGC is even better in Java 17, faster Maven builds, BGP and Facebook, pattern matching future, and economy of code ownership!
Error Handling in gRPC
Filed under Java
Learn how to implement error handling in gRPC for unary and stream-based RPC calls.
Using a Custom Class as a Key in a Java HashMap
Filed under Java Map
Learn how to use custom classes as keys in Maps in Java.
Get the Last Word of a String
Filed under Java String
A quick and practical overview of getting the last word of a String in Java.
Convert Long to String in Java
Filed under Java Numbers
A quick and practical overview of converting Long to String in Java.
Spring Security – Request Rejected Exception
Filed under Spring Security
Explore Spring Security’s protection against malicious URLs that may cause the Path Traversal/Directory Traversal attacks.
Java Weekly, Issue 405
Filed under Weekly Review
Spring configurations, Java 18 snippets, Spring 6, Micronaut 3.0, Netflix’s media packaging, and atomic habits for software engineers!
Add a Reference to Method Parameters in Javadoc
Filed under Java
Learn how to create references to method parameters in Javadoc.
JUnit 4 on How to Ignore a Base Test Class
Filed under Testing
Learn possible solutions to skip running tests from base test classes in JUnit 4
Email Validation in Java
Filed under Java
Learn how to validate email addresses in Java using regular expressions.
Get a Submap From a HashMap in Java
Filed under Java Map
A quick and practical guide to deriving a submap from a HashMap in Java.
Consistency Levels in Cassandra
Filed under NoSQL
Learn about consistency levels in Cassandra.
Java Weekly, Issue 404
Filed under Weekly Review
GC improvements in Java 17, better Foreign Memory API, Spring Boot scheduling, javac Trees, A/B testing at Netflix, and more from K8S 1.22.
Streaming with gRPC in Java
Filed under Java
A quick and practical guide to gRPC streaming in Java.
Java Sound API – Capturing Microphone
Filed under Java
Learn how to capture microphone input and save it to a file.
Fixing the “Declared package does not match the expected package” Error
Filed under Java
If the package name of a java file does not match its location on the file system, we’ll get an error. We look at a few common causes for this and how to fix it.
HTML to PDF Using OpenPDF
Filed under Java IO
Learn how to convert HTML to PDF in Java using OpenPDF and Flying Saucer or using the Open HTML to PDF library, with a little help from Jsoup.
Collecting Stream Elements into a List in Java
Filed under Java Streams
Learn how to collect Stream elements into a List in different versions of Java, and the pros and cons of the approaches.
Get All Running JVM Threads
Filed under JVM
A quick and practical guide to listing all JVM threads.
Different Log4j2 Configurations per Spring Profile
Filed under Spring
A quick and practical guide to configuring different Log4j2 configs per Spring profile.
Java Weekly, Issue 403
Filed under Weekly Review
Java 17 is released, more LTS versions for Java, Java modules, Spring without annotation, Netflix’s API Gateway, and exotic timezones!
Priority of a Thread in Java
Filed under Java Concurrency
Learn about Thread priority values in Java, how to set them, and how the Java scheduler uses them to prioritize threads to execute.
Performance of System.arraycopy() vs. Arrays.copyOf()
Filed under Java Array
Learn about the implementation and performance of System.arraycopy() and Arrays.copyOf()
Guide to mapMulti in Stream API
Filed under Java Streams
A quick and practical guide to the new Stream.mapMulti method in Java.
Generate a Java Class From JSON
Filed under JSON
Learn how to create a Java class from a JSON object using the jsonschema2pojo library
Java Weekly, Issue 402
Filed under Weekly Review
Ready for Java 17? Spring baselining on Java 17, migration tips, and IntelliJ support. Also, more efficient gRPC, 10 years of Kotlin, and simplifying hard tasks!
Enabling Unlimited Strength Cryptography in Java
Filed under Security
Learn why and how to enable unlimited strength cryptography in different versions of Java.
Understanding Maven’s “relativePath” Tag for a Parent POM
Filed under Maven
Learn about the Parent POM resolution of Maven.
Connecting to a Specific Schema in JDBC
Filed under Persistence
In this article, we’ll cover the basics of database schemas, why we need them, and how they are useful. After that, we’ll focus on practical examples of setting schema in JDBC with PostgreSQL as a database.
Find the IP Address of a Client Connected to a Server
Filed under Networking
We can find the address of a client connected to our application by using the APIs within the java.net package. We look at establishing a TCP socket and understanding its properties.
Javadoc: @version and @since
Filed under Java
In this tutorial, we’ll focus on the @version and @since tags in Javadoc.
Test WebSocket APIs With Postman
In this article, we’ll create an application with WebSocket and test it using Postman.
Java Weekly, Issue 401
Filed under Weekly Review
Plans for Spring 6.0, structured logging, subtleties of soft-deletion in Hibernate, event-sourcing at Netflix, GCToolkit from Microsoft, and beautiful Powershell!
Format a Milliseconds Duration to HH:MM:SS
Filed under Java Dates
Learn how to use Java’s Duration, TimeUnit, and third-party libraries to format a duration to a specific format
The DTO Pattern (Data Transfer Object)
Filed under Architecture
Explore the definition of the DTO Pattern and its reason for existing, and how to implement it.
Java Weekly, Issue 400
Filed under Weekly Review
Micronaut 3 is released, Spring IoC, source code snippets in Java 18, panache repository pattern, filtering out syscalls in K8S, and climate change!
Gradle Offline Mode
Filed under Gradle
Learn how to use Gradle in offline mode, whether you’re working from the command line, IntelliJ IDEA, or Eclipse.
Custom Serializers in Apache Kafka
In this tutorial, we’ll see how to implement Kafka default format converters and custom serializers for specific use cases.
Cassandra Partition Key, Composite Key, and Clustering Key
Learn how a partition key, composite key, and clustering key form a primary key and also how they differ
Run JUnit Test Cases From the Command Line
Filed under Testing
Learn how to run JUnit 5 tests directly from the command line with and without Maven
Display Custom Items in JavaFX ListView
Filed under Java
Explore a way to show custom items in JavaFX ListView.
Deploying a Java War in a Docker Container
Filed under Docker
Learn how to deploy a Java WAR file in a Docker container using the official Tomcat Docker image
Change the Default Location of the Log4j2 Configuration File in Spring Boot
Filed under Spring Boot
Learn different ways to change the default location of the Log4j2 configuration file in Spring Boot.
Java Weekly, Issue 399
Filed under Weekly Review
A cool interview with Java architects, Vector API, getting the most out of Hibernate, K8S with more windows, and continuous configuration with AWS!
Compare the Content of Two Files in Java
Filed under Java IO
A quick and practical guide to comparing the contents of two files in Java.
Inserting Delays Between Requests in Apache JMeter
Filed under Testing
To simulate user activity, we often need to add timing to our JMeter configuration. We explore how to build a test plan with gaps between actions.
Java Weekly, Issue 398
Filed under Weekly Review
Java 16 new features, reflection meets method handles, active record panache, gateway pattern, and swapping in K8S.
Throwing Exceptions in Constructors
Filed under Core Java
Learn about throwing exceptions in a constructor.
Hosting a Maven Repository on GitHub
Filed under Maven
A quick and practical guide to hosting Maven repositories on GitHub.
Java Annotation Attribute Value Restrictions
Filed under Core Java
Learn some reasons for this limitation and look under the hood of the JVM to explain it better
Java Weekly, Issue 397
Filed under Weekly Review
Project Loom vs Reactive Programming, GraalVM improvements, Spring Data Projections, feature parity pattern, and a new K8S release!
Difference Between MVC and MVP Patterns
Filed under Architecture
Learn about the differences between the MVC and MVP Patterns.
How to Create Password-Protected Zip Files and Unzip Them in Java
A quick and practical guide to working with password-protected ZIP files in Java.
EntityNotFoundException in Hibernate
Filed under Persistence
Explore situations when EntityNotFoundException occurs and solutions to handle it.
Default Values for Maven Properties
Filed under Maven
In this short article, we’ll go through how to configure Maven properties default values, and how to use them.
Calling a SOAP Web Service from the Command Line
Filed under Web Services
A quick and practical guide to calling SOAP WebServices from the command line.
Linking to an External URL in Javadoc
Filed under Java
Learn how to use Javadoc to link to external urls.
Java Weekly, Issue 396
Filed under Weekly Review
Java’s 6-month cadence dilemma, Panache versatility, retrying with Resilience4j, testing in Spring Boot, and a new major Cassandra version.
CQL Data Types
Filed under NoSQL
Learn about some of the different data types of the Apache Cassandra database.
Find Whether an IP Address Is in the Specified Range or Not in Java
Filed under Networking
Learn how to check if an IP address is in a given range in Java.
Java Weekly, Issue 395
Filed under Weekly Review
Tunneling to Rust from Java, RabbitMQ streams, fewer releases for K8S, and why agile transformation fails!
Significance of Getters and Setters in Java
Filed under Core Java
Explore the pros and cons of using getters and setters in Java.
Valid @SuppressWarnings Warning Names
Filed under Java
A quick and practical guide to @SuprressWarnings and its parameters.
Convert a String to Camel Case
Filed under Java String
Camel case text conversion can be achieved by using regular expressions, or via some library functions. We look at a couple of implementations we can add to our own code, and a couple of examples from libraries.
Guava’s Futures and ListenableFuture
Filed under Java Concurrency
Learn about Guava’s support in async programming: Futures and ListenableFuture
Creating a Self-Signed Certificate With OpenSSL
Filed under Security
A quick and practical guide to creating self-signed certificates with OpenSSL.
Java Weekly, Issue 394
Filed under Weekly Review
Quarkus and Hibernate, Kotlin internal, the road to K8S 1.22, Elasticsearch meets Amsterdam, and the messy IoT world!
Additional Source Directories in Maven
Filed under Maven
Learn how to configure additional source directories in Maven.
Converting String to BigInteger in Java
Filed under Java String
Learn to convert a String to a BigInteger in Java.
Java Weekly, Issue 393
Filed under Weekly Review
Quarkus 2.0, GraphQL meets Spring, experimenting with GitHub’s copilot, read-only hints for Hibernate, and uncovering better ways for working!
Count Occurrences Using Java groupingBy Collector
Filed under Java Map
Learn how to use Collector.groupingBy() to group the equal objects.
The java.lang.NoClassDefFoundError in JUnit
In this article, we’ll understand why the java.lang.NoClassDefFoundError occurs in JUnit and how to fix it.
Send Large Messages With Kafka
Filed under Data
A quick and practical explanation of how to send large messages with Kafka.
“Code too large” Compilation Error in Java
Filed under Java
Learn what causes the compiler error “code too large”, along with situations where we might encounter it and what we can do to fix it.
Different Serialization Approaches for Java
Filed under Java
Learn several approaches for serializing Java objects using third-party libraries or core Java’s built-in serialization API.
JPA Entities and the Serializable Interface
Filed under JPA
Learn when and why to use the Serializable interface in JPA entities according to the JPA specification.
Java Weekly, Issue 392
Filed under Weekly Review
Busy week for Spring projects, Hibernate physical naming strategy, Spring-ified ElastiCache, clocks in distributed systems, and Istio to the rescue!
Enabling Logging for Apache HttpClient
Filed under HTTP Client-Side
Learn how to enable logging for the Apache HttpClient.
Generating Alphanumeric UUID String in Java
Filed under Java String
A practical comparison of various UUID generation methods in Java.
Private Constructors in Java
Filed under Core Java
Learn about private constructors in Java.
Running Selenium Scripts with JMeter
Filed under Testing
Learn how to run a Selenium script using JMeter.
Cluster, Datacenters, Racks and Nodes in Cassandra
Explore the basic components of Cassandra’s architecture.
Logical vs Bitwise OR Operator
Filed under Java
Java supports two variations of OR with different operator precedence and runtime behaviour. We explore how logical OR short-circuits and how bitwise OR applies to numbers and boolean values.
How to Get the Number of Threads in a Java Process
Filed under Java Concurrency
Learn how to check the number of threads created by a Java process.
Java Weekly, Issue 391
Filed under Weekly Review
Going from imperative to the reactive paradigm, web standards, and the future of the internet. Good stuff.
A Comparison Between JPA and JDBC
Filed under JPA
Learn about the differences between JPA and JDBC.
Java DocLint
Filed under Java
Learn how to use Java DocLint to analyze your Javadoc.
What Does Mono.defer() Do?
Filed under Reactive
Learn about Monod.defer() and how it is related to lazy and eager evaluation.
Connection Timeout vs. Read Timeout for Java Sockets
Filed under Java, Networking
Learn about the timeout exceptions of Java socket programming
Command Line Arguments as Maven Properties
Filed under Maven
In this short tutorial, we’ll look at how we can pass arguments to Maven using the command line.
Java Weekly, Issue 390
Filed under Weekly Review
New Boot and Java goodness – things are certainly moving fast. And our last COVID launch started yesterday.
Wire Tap Enterprise Integration Pattern
Filed under Architecture
A guide to the
Wire Tap Enterprise Integration Pattern (EIP)
Max-Http-Request-Header-Size in Spring Boot
Filed under Spring Boot
Learn how to set and use the max-http-header-size property in a Spring Boot 2.x application.
Referencing a Method in Javadoc Comments
Filed under Java
Learn to reference a method in Javadoc comments.
Mask Sensitive Data in Logs With Logback
Learn how to use the PatternLayout feature to mask sensitive data in application logs with Logback
JPA Support – State of the Tools Ecosystem in 2021
Filed under JPA
An overview of the JPA plugins available for IntelliJ and Eclipse
Non-Capturing Regex Groups in Java
Filed under Java String
Explore how to use non-capturing groups in Java Regular Expressions
Java Weekly, Issue 389
Filed under Weekly Review
JFR mirror events, testing RSocket, deep dive in SQL execution plans, eBPF at Netflix, and space exploration with AWS!
Local JAR Files as Gradle Dependencies
Filed under Gradle
Learn how we can add local JAR files to our Gradle dependencies.
Inserting Null Into an Integer Column Using JDBC
Filed under Persistence
Learn how to store null values in a database using plain JDBC.
Understanding the Pattern.quote Method
Filed under Java
When using regular expressions in Java, sometimes we need to match regex patterns in their literal form – without processing any metacharacters. Let’s find out how we can do that.
Spring Validation in the Service Layer
Filed under Spring
A quick and practical introduction to service layer validation in Spring.
Log4j Warning: “No Appenders Could Be Found for Logger”
Filed under Logging
Learn why the Log4j warning, “No appenders could be found for logger” occurs and how to resolve it, both in configuration and in Java code.
Java Weekly, Issue 388
Filed under Weekly Review
Safe natives in Java, secure microservices with Spring Security, continuous testing in Quarkus, AWS timeseries, and different test levels!
Kafka Streams vs. Kafka Consumer
Filed under Data
Learn how Kafka Streams simplify the processing operations when retrieving messages from Kafka topics.
Defining Unique Constraints in JPA
Filed under JPA
Learn how to define unique constraints on entity classes in JPA and Hibernate.
Finding All Classes in a Java Package
Filed under Java
Learn how to find all classes in a Java package at runtime.
Secret Key and String Conversion in Java
Filed under Security
A quick and practical introduction to secret key and string conversion in Java.
Java Weekly, Issue 387
Filed under Weekly Review
Spring Boot 2.5 is released, large pages on JVM, hacking JVM, mapMulti for streams, project loom, and a service-oriented language!
Downloading Email Attachments in Java
Filed under Java
Learn how we can download email attachments using the JavaMail API
Maximum Size of Java Arrays
Filed under Java Array
Learn about the maximum size of Java arrays.
IllegalAccessError in Java
Filed under Java
Learn about the java.lang.IllegalAccessError.
AliasFor Annotation in Spring
Filed under Spring
Learn about the @AliasFor annotation in the Spring Framework.
Guava Guide
Filed under Series
Learn how to use Google Guava, the popular Java open-source library of common utilities
Java Weekly, Issue 386
Filed under Weekly Review
Kafka without ZooKeeper in action, type patterns in Java 17, JFR streaming, JPA entity graph, and applying ML to DevOps issues!
How to Display a Message in Maven
Filed under Maven
Learn how to print messages to the console or to a file during a Maven build using various plugins.
How to Implement a Soft Delete with Spring JPA
Filed under Spring Data
Physically deleting data from a table is usual when interacting with databases. But sometimes there are business requirements to not permanently delete data from the database. In this tutorial, we’ll learn about soft delete and how to implement this technique with Spring JPA.
Converting String to BigDecimal in Java
Filed under Java String
Explore multiple methods to convert String to BigDecimal values.
Build a Trading Bot with Cassandre Spring Boot Starter
Filed under Spring Boot
Learn how to create a strategy interacting with a crypto exchange and test it against historical data.
Overriding Column Definition With @AttributeOverride
Filed under JPA
Learn how to use @AttributeOverride to change a column mapping
Split a String in Java and Keep the Delimiters
Filed under Java String
Learn how to split a string in such a way that the delimiters are part of the result
HandlerInterceptors vs. Filters in Spring MVC
Filed under Spring MVC
Compare the Java servlet Filter and the Spring MVC HandlerInterceptor and learn when one might be preferable over the other
Code Coverage with SonarQube and JaCoCo
Filed under Testing
A guide to measuring code coverage using SonarQube and JaCoCo.
Returning an Auto-Generated Id with JPA
Filed under JPA
In this tutorial, we’ll discuss how we can handle auto-generated ids with JPA.
Copying Files With Maven
Filed under Maven
Learn how to copy a source file to a destination using three different Maven plugins.
HTTP PUT vs. POST in REST API
Filed under REST, Spring Boot
Learn the differences between HTTP POST and PUT methods and when to use each in a RESTful API.
Java Weekly, Issue 385
Filed under Weekly Review
Non-blocking networking with Project Loom, teeing collector, Spring and AWS SQS, Kotlin 1.5, and strong consistency in AWS S3!
Using an Interface vs. Abstract Class in Java
Filed under Core Java
Learn when to use an interface and when to use an abstract class in Java.
Fixing the NoSuchMethodError JUnit Error
Filed under Testing
Learn how to fix the NoSuchMethodError and NoClassDefFoundError JUnit errors
How to Convert Mono<List<T>> Into Flux<T>
Filed under Reactive
Learn to convert a Mono of a collection to Flux of the collection’s items.
Java Weekly, Issue 384
Filed under Weekly Review
Superior Java records, Kotlin 1.5, code examples in Javadoc, stream collector, Spring Cloud Gateway meets K8S, indexing JSON columns, and COIVD predictions!
Converting a Java Keystore Into PEM Format
Learn how to convert certificates and private keys from a Java KeyStore into PEM format using keytool and openssl.
Java Weekly, Issue 383
Filed under Weekly Review
Backward compatibility and Javac, Micronaut hipster, faster Graal, life after SecurityManager, API gateway in K8S, and Bitcoin’s energy problem!
Introduction to Debezium
Filed under Data
Learn about CDC using Debezium and Java.
Convert an Array of Primitives to an Array of Objects
Filed under Java Array
Learn to convert an array of primitives to an array of objects.
Advise Methods on Annotated Classes With AspectJ
Filed under Java
Learn how to write trace logging output when calling methods of configured classes using AspectJ.
Java Weekly, Issue 382
Filed under Weekly Review
Spring Data improvements, more from project Panama, delegation in Kotlin, deprecating security manager, clustered indices, and indexed jobs in K8S!
How to Handle InterruptedException in Java
Filed under Java Concurrency
Learn about Java’s InterruptedException, what causes it, and how to handle it.
Split Java String by Newline
Filed under Java String
Learn different ways to split a Java String by newline characters
The package-info.java File
Filed under Java
Learn about the package-info.java file, what its purpose is, and how we can use it to specify package-level Javadocs and annotations.
Displaying Error Messages with Thymeleaf in Spring
Filed under Spring MVC
Learn how to build a simple Spring application to demonstrate how to display various types of errors in Thymeleaf.
Spring Bean Names
Filed under Spring
Learn about different Spring bean naming strategies.
Convert a Java Enumeration Into a Stream
Filed under Java Streams
In this short tutorial, we’re going to implement a utility method for converting Enumeration objects to the Java Stream API
Java Weekly, Issue 381
Filed under Weekly Review
A busy week for the Spring team, new JMC version, Microsoft loves OpenJDK, CronJobs on K8S, and introducing weakness-oriented hiring!
Usage of the Hibernate @LazyCollection Annotation
Filed under Persistence
Learn about the two main design patterns for fetching and how they relate to the @LazyCollection annotation in Hibernate
Java Weekly, Issue 380
Filed under Weekly Review
Microsoft’s OpenJDK, serializing records, rate-limiting with Spring, vector API, PodSecurityPolicy deprecation in K8S, and capturing two dimensions of time!
Backpressure Mechanism in Spring WebFlux
Filed under Reactive
In this tutorial, we’ll explain what it is and how to apply backpressure mechanism in Spring WebFlux to mitigate it.
Java Technical Editor (part-time)
Filed under Java
Join the Baeldung editorial team.
Spring Boot With JavaServer Pages (JSP)
Filed under Spring Boot
Learn how to build a web application with Spring Boot and JSP.
Java Weekly, Issue 379
Filed under Weekly Review
Pattern matching meets switch expressions, working with lazy relationships, Spring Boot for serverless, the road to Kotlin 1.5 and Java 17, and tips for working from home!
Open API Server Implementation Using OpenAPI Generator
Filed under Spring
Learn how to generate a Spring-based server stub from a YAML specification using the OpenAPI generator’s Maven plugin.
Java Class File Naming Conventions
Filed under Core Java
Understand autogenerated class naming conventions in Java.
Count Query In jOOQ
Filed under Persistence
Learn different ways to perform a record count with jOOQ.
Java Weekly, Issue 378
Filed under Weekly Review
Primitive objects, more performant ZGC, trying Spring native, more secure Java 16, concurrency control approaches, and 15 years of S3.
Spring Reactive Guide
Filed under Reactive, Series, Spring Web
A series of tutorials on reactive programming support in Spring
Java Weekly, Issue 377
Filed under Weekly Review
Java 16 is released, official native images for Spring, backpressure, Jetty HTTP load generator, GitHub actions, and say no to SOLID!
Clearing the Maven Cache
Filed under Maven
In this short tutorial, we’ll explore ways to clear our local Maven cache.
Spring Security OAuth Authorization Server
Filed under Spring Security
Learn how to use the Spring Security OAuth Authorization Server.
Java Weekly, Issue 376
Filed under Weekly Review
On Java 16 and beyond: Records, Vector API, Unix domain sockets, UTF-8 everything, and Project Valhalla. Also, slow queries with Hibernate, and Kind over minikube!
Guide to Purging an Apache Kafka Topic
Filed under Data
Explore a few strategies to purge data from an Apache Kafka topic
Java Weekly, Issue 375
Filed under Weekly Review
Deserialization events in JFR, more efficient G1, native images, Scala 3, pattern matching for primitives, merge join algorithm, and effective communication.
Invoking a Private Method in Java
Filed under Java
We sometimes need to access private methods from our code, especially our test code. In this tutorial we cover a couple of ways to make private methods accessible.
Java Weekly, Issue 374
Filed under Weekly Review
Streaming options, initializing testcontainers, faster charset decoding, DDD in Java, GraphQL microservices, and recipes for being an enabler manager!
Where Does Java’s String Constant Pool Live, the Heap or the Stack?
Filed under Java String
Learn about the storage area for String constant pool.
Override Maven Plugin Configuration from Parent
Filed under Maven
While we want to modularise our maven file to avoid repetition, sometimes it’s necessary to provide specific variations for child modules. Here we explain how the various tiers of a maven file can be combined.
How To Configure Java Heap Size Inside a Docker Container
Filed under Docker
To run Java in a docker container we may need to set the correct memory allocation settings, or use a JVM which is aware that it is running in a container. We discover how to optimise a docker build for our Java application’s memory.
Configuring Message Retention Period in Apache Kafka
Learn how to configure time-based message retention properties for Kafka topics
Java Weekly, Issue 373
Filed under Weekly Review
Maven central security, breaking a monolith, quarkus testing, more efficient Md5, introducing latency in SQL queries, and chaos engineering!
File Upload With Open Feign
Filed under REST, Spring Cloud
Learn how to implement a Multipart File upload using OpenFeign.
Java Weekly, Issue 372
Filed under Weekly Review
Java 16 goes RC1, Unix-domain sockets, native images, jOOQ internals, metrics meets open tracing, joining tables with a hash-join algorithm, and having more effective meetings!
Java HashMap Load Factor
Filed under Java Map
In this article, we’ll see the significance of the load factor in Java’s HashMap and how it affects the map’s performance.
Java Weekly, Issue 371
Filed under Weekly Review
Experimenting with Unix-domain sockets, more randomness, Java on Java, vectorization, the benefits of pull requests, and the story of Netflix’s homepage!
Multiple Submit Buttons on a Form
Filed under Spring MVC
Learn how to add another button to the same form in a Spring MVC application that maps to the same RequestMapping on the controller.
Using the Map.Entry Java Class
Filed under Java Map
We often use maps to store a collection of key-value pairs. We explore the Entry objects inside a map and how to make the most of them.
Java Weekly, Issue 370
Filed under Weekly Review
Java turns 25, interview with Brian Goetz, scalable batching processing, more pattern matching, foreign memory access, idempotent consumers, and latency numbers for teams!
An Introduction to the Constant Pool in the JVM
Filed under JVM
Learn about the constant pool in JVM.
Structural Patterns in Core Java
Filed under Architecture, Java
Learn how some core libraries in Java have adopted the seven core structural design patterns
Java Weekly, Issue 369
Filed under Weekly Review
Run Java on Java, reactive JAX-RS, inline and primitive objects, Java 17 new additions, state watch pattern, and guidelines for pair programming!
How to Analyze Java Thread Dumps
Filed under DevOps, Java Concurrency
Learn how to analyze thread dumps to efficiently diagnose performance issues. Also, we’ll learn to detect bottlenecks or even simple bugs.
How to Convert a Hibernate Proxy to a Real Entity Object
Filed under Persistence, Spring
In this tutorial, we’ll learn how to convert a Hibernate proxy to a real entity object
Evaluating a Math Expression in Java
Filed under Java Numbers
Learn how to evaluate math expressions expressed in String format in Java using exp4j, Javaluator, and the Java Scripting API.
Java Weekly, Issue 368
Filed under Weekly Review
Pattern matching and guards, fat JARs, Reactive Hibernate, HTTP clients and Project Reactor, timed leasing for distributed systems, and when to say No!
Determine if an Integer’s Square Root Is an Integer in Java
Filed under Algorithms
Finding if an integer’s square root is also an integer is an interesting subject. Let’s look at some techniques we can use.
Java File Separator vs File Path Separator
Filed under Java IO
To make our code portable between operating systems, we need to handle the directory and path separator characters correctly. We look at a few ways that Java can help use the correct characters for the host operating system.
Java Weekly, Issue 367
Filed under Weekly Review
An OpenJDK with JWarmup and coroutines, pattern matching for arrays, JVM performance rabbit hole, distributed metadata management, and a more effective developer experience!
Difference Between JSF, Servlet, and JSP
Filed under Architecture
Explore the purpose of each technology, its lifecycle, and prominent features.
Learn JPA & Hibernate
A series of tutorials on the core features of JPA and Hibernate.
New Features in Java 12
Filed under Core Java
Explore the new features implemented in Java 12.
Data Modeling with Apache Kafka
Filed under Algorithms, DevOps
Learn how to use a Docker environment to cover the fundamentals of data modeling for a system that uses Apache Kafka for message processing.
Java Weekly, Issue 366
Filed under Weekly Review
Millions of virtual threads, virtual thread pools, GraalVM meets COBOL, Intellij on M1, Telemetry and Protobuf, and Spec updates for Java 16!
Character#isAlphabetic vs. Character#isLetter
Filed under Core Java
Understand the difference between the isAlphabetic() and isLetter() methods of the Java Character class.
Java Weekly, Issue 365
Filed under Weekly Review
Virtual threads in Helidon, Out of native memory, circuit breakers, testing HTTP clients, container security, and all benchmarks are wrong!
Collections.synchronizedMap vs. ConcurrentHashMap
Filed under Java Concurrency, Java Map
Learn the differences between Collections.synchronizedMap and ConcurrentHashMap.
Spring Boot: Customize the Jackson ObjectMapper
Filed under Jackson, Spring Boot
Learn how to configure the serialization and deserialization options for Jackson using Spring Boot.
New Features in Java 14
Filed under Core Java
Explore various JEPs of Java 14.
Java Weekly, Issue 364
Filed under Weekly Review
The one with performance: HotSpot JVM intrinsics, AppCDS with jLink, gRPC meets Kotlin, Maven’s speed daemon, JDBC’s statement caching, and Apple’s M1!
Scheduled WebSocket Push with Spring Boot
Filed under Spring Boot
In this tutorial, we’ll see how to send scheduled messages from a server to the browser using WebSockets.
Java Weekly, Issue 363
Filed under Weekly Review
Lots of innovation happening: HTTP/3 in Netty, Reactive Hibernate, Static images for JVM, Maven 4, Docker deprecation on K8S, and also, the value of 1-on-1 sessions!
Comparing Doubles in Java
Filed under Java Numbers
In this tutorial, we’ll talk about the different ways of comparing double values in Java.
A Guide to MultipleBagFetchException in Hibernate
Filed under Persistence
Learn about the MultipleBagFetchException in detail.
Java Weekly, Issue 362
Filed under Weekly Review
Say hello to Java 16: one small step towards value types and a more efficient Metaspace. Also, buildpacks with layered Jars, and becoming an effective team lead!
Introduction to Servlets and Servlet Containers
Filed under Jakarta EE
Learn the concepts around servlets, their containers, and a few essential objects they revolve around.
NoSuchFieldError in Java
Filed under Java
Let’s understand the cause behind NoSuchFieldError and how to resolve it.
Thymeleaf Variables
Filed under Spring Boot
Learn how to define and use variables in Thymeleaf
Security Context Basics: User, Subject and Principal
Filed under Security
A quick overview of basic terms associated with the security context.
Digital Certificate: How to Import .cer File into Truststore File
Filed under Security
Learn about a few tools that we can use to import certificates in .cer format into the client’s truststore
Java Weekly, Issue 361
Filed under Weekly Review
New release of GraalVM, Speculating over the fate of Loom and Valhalla, Building a server framework, Cloud computing and climate change, and in praise of humility!
The Capacity of an ArrayList vs the Size of an Array in Java
Filed under Java Array
The capacity of an ArrayList functions differently to the size of an Array. We explore the differences and when it’s a good idea to set an ArrayList’s size.
Performance Difference Between save() and saveAll() in Spring Data
Filed under Persistence, Spring Data
A quick and practical performance comparison between save() and saveAll() in Spring Data.
Creating a Generic Array in Java
Filed under Java Array
The loose types of Java generics are hard to coerce into the strong types of Java arrays. We explore the problem and some common solutions.
Reusing Docker Layers with Spring Boot
Filed under Docker, Spring Boot
In this tutorial, we’ll see how to exploit the new capabilities of Spring Boot to reuse Docker layers.
Java Weekly, Issue 360
Filed under Weekly Review
Meet Spring Boot 2.4, Embracing subatomic Java, Catching up with the new Java features, and a set of practical guides on distributed systems.
Maven Packaging Types
Filed under Maven
In this article, we explore the different packaging types available in Maven.
Java Weekly, Issue 359
Filed under Weekly Review
All things Reactive: R2DBC joins Reactive Foundation, Reactive Manifesto II, and The Reactive Principles. NUMA meets G1, GraphQL at scale, and write angry!
JPA CascadeType.REMOVE vs orphanRemoval
Filed under JPA
Learn about the difference between JPA CascadeType.REMOVE and orphanRemoval for deleting entities.
Ignoring Fields With the JPA @Transient Annotation
Filed under JPA
Learn how to ignore fields using the JPA @Transient annotation in Java.
Localizing Exception Messages in Java
Filed under Java
Learn how to use the getLocalizedMessage() method to provide localized exception messages
Java IndexOutOfBoundsException “Source Does Not Fit in Dest”
Filed under Java Collections
Learn about the IndexOutOfBoundsException: “Source does not fit in dest” in Java.
Check if a Java Program Is Running in 64-Bit or 32-Bit JVM
Filed under JVM
Learn how a Java program can detect whether it’s running in a 64-bit or 32-bit JVM.
Java Weekly, Issue 358
Filed under Weekly Review
2 million virtual threads with Loom, reactive to coroutines, cloud-native Spring Boot, working effectively with databases and context matters!
The transient Keyword in Java
Filed under Core Java
Learn about the transient keyword and see its behavior through examples
Understanding the & 0xff Value in Java
Filed under Core Java
Learn how to use the 0xff value with the bitwise AND operator in Java.
Apache Commons Collections vs Google Guava
Filed under Java Collections
Explore the functionality offered by Apache Commons and Google Guava, specifically in the area of the collections framework.
Java Weekly, Issue 357
Filed under Weekly Review
Revisiting project Jigsaw and first-level cache in Hibernate, a little competition for SDKMAN!, moving data at petabyte scale, and fallacies about time and timezones!
Retrofit 2 – Dynamic URL
Filed under HTTP Client-Side
Learn how to create a dynamic URL in Retrofit2
Accessing Keycloak Endpoints Using Postman
Learn about the Keycloak REST APIs and how to call them in Postman
Java Weekly, Issue 356
Filed under Weekly Review
Tale of legendary duos: Shenandoah and Java 11, Unix sockets and Java 16, TestContainers and JPA, and finally Distributed Tracing and Netflix!
Getting Database URL From JDBC Connection Object
Filed under Persistence
Learn how to obtain the database URL from a JDBC Connection object.
Java Weekly, Issue 355
Filed under Weekly Review
Project Panama delivers, Dockerizing Java applications, EFK stack for logging, a little about queuing theory, and COBOL ain’t gonna go anytime soon.
Java Weekly, Issue 354
Filed under Weekly Review
Everything revolves around JVM: Talking with the Shenandoah team, JIT and Graal internals, current trends in the Java ecosystem, and learning a new programming language!
How to Stop Execution After a Certain Time in Java
Filed under Java Concurrency
Learn different ways to end a long-running execution after a certain time in Java.
Background Jobs in Spring with JobRunr
Filed under Spring Boot
Look into distributed background job scheduling and processing in Java using JobRunr and have it integrate with Spring.
Checking if a Java Class Is ‘Abstract’ Using Reflection
Filed under Java
Learn how to check whether a Java class is abstract using the Reflection API.
Using libphonenumber to Validate Phone Numbers
Filed under Java
Explore the functionality offered by libphonenumber to format and validate phone numbers using code samples.
Java Weekly, Issue 353
Filed under Weekly Review
Back to the basics: one step closer to inline classes, benchmarking GC latencies, Java after 8, and why it’s not a good idea to rely on averages!
Getting Started with jOOQ
Filed under Persistence
Learn how to configure and create a simple CRUD application using the jOOQ framework.
How To Get Cookies From the Apache HttpClient Response
Filed under HTTP Client-Side
Learn how to retrieve and set cookies from Apache’s HttpClient response
Reading an HTTP Response Body as a String in Java
Filed under HTTP Client-Side, REST, Spring
Explore several options for reading an HTTP response body as a string in Java
@BeforeAll and @AfterAll in Non-Static Methods
Filed under Testing
While unit testing, we may occasionally want to use @BeforeAll and @AfterAll in non-static setup and tear-down methods. Let’s see how we can do it.
How to Set TLS Version in Apache HttpClient
Filed under HTTP Client-Side, Security
Learn how to set the TLS version in Apache HTTPClient
Guide to the Gradle Wrapper
Filed under Gradle
In this tutorial, we’ll learn about Gradle Wrapper, an accompanying utility that makes it easier to distribute projects.
Java Weekly, Issue 352
Filed under Weekly Review
More resilient Java with Bulkheads, a new ML library for Java, GraalVM native images, Spring Boot performance, reinventing VMs, and talent isn’t everything! Oh, and the Baeldung “sale”. Good stuff this week.
Listing the Available Cipher Algorithms
Filed under Security
Let’s take a look at how we can list the available cipher algorithms.
CharacterEncodingFilter In SpringBoot
Filed under Spring Boot
Learn about the CharacterEncodingFilter and its usage in a Spring Boot application.
Get the First Key and Value From a HashMap
Filed under Java Map
In this tutorial, we’ll discuss how to get the first key-value pair from a HashMap without knowing the key.
Checking if a Method Is Static Using Reflection in Java
Filed under Java
Learn how we can check if a method is static or not.
Sending Emails with Attachments in Java
Filed under Java
Learn how to send emails with single and multiple attachments in Java.
How to Remove a Prefix From Strings in Groovy
Filed under Groovy
Learn how to remove the prefix from a string using Groovy.
Java Weekly, Issue 351
Filed under Weekly Review
Java 15 goes GA, A collection of Spring/JPA topics, creating highly scalable distributed systems, and good looking GitHub profiles!
Differences in @Valid and @Validated Annotations in Spring
Filed under Spring Web
Explore the key differences between the @Valid and @Validated annotations.
Arrays.asList vs new ArrayList(Arrays.asList())
Filed under Java Collections
They may look very similar but they aren’t. Let’s explore why.
How to Implement Hibernate in an AWS Lambda Function in Java
Filed under Cloud, Persistence
Look at the challenges of using any RDBMS within a Lambda, and how and when Hibernate can be useful
Java Weekly, Issue 350
Filed under Weekly Review
GC enhancements in Java 15, JPA lifecycle events, Docker and Spring Boot, Distributed tracing, and perks of hiring junior engineers: packed in a diverse weekly!
Keycloak User Self-Registration
Filed under Security
Learn how to enable user self-registration in Keycloak.
Rolling Back Migrations with Flyway
Filed under Persistence
Learn how to safely roll back migrations using Flyway.
Dates in OpenAPI Files
Filed under Spring Web
Let’s see how to declare dates in an OpenAPI file, in this case, implemented with Swagger.
IllegalMonitorStateException in Java
Filed under Java Concurrency
If you want to learn why your code keeps throwing this exception, this article is for you.
Custom User Attributes with Keycloak
Filed under Spring
Learn how to add extra attributes to a user in Keycloak.
Java Weekly, Issue 349
Filed under Weekly Review
Faster startup for JVM, mind-boggling Java puzzlers, customizing JPA repositories, Slicing Boot tests, and professional video calls: All in a very diverse weekly!
Hiding Endpoints From Swagger Documentation in Spring Boot
Filed under REST, Spring Boot, Spring Web
Let’s have a look at how we can hide endpoints from Swagger API documentation.
Assert Two Lists for Equality Ignoring Order in Java
Filed under Java Collections, Testing
Learn how to make order agnostic comparison of lists when writing unit tests.
Guide to ArrayStoreException
Filed under Java Array
Learn the cause of ArrayStoreException, how to handle it, and best practices for avoiding it
Testing Quarkus Applications
Learn how to write clean and powerful unit and integration tests for Quarkus applications.
Largest Power of 2 That Is Less Than the Given Number with Java
Filed under Algorithms, Java Numbers
Learn how to find the largest power of 2 that is less than an input number.
Introduction to keytool
Learn how to generate certificates with keytool.
Java Weekly, Issue 348
Filed under Weekly Review
Kotlin 1.4 is out with lots of small yet useful features! Intriguing topics on GraalVM, Spring, Hibernate, and SQL. Also, more patterns to design distributed systems.
Spring MVC Async vs Spring WebFlux
Filed under Reactive, Spring MVC
Learn about Spring Async and Spring WebFlux both theoretically and practically with a basic load test
Using application.yml vs application.properties in Spring Boot
Filed under Spring Boot
Spring Boot supports both .properties and YAML. We explore the differences between injecting properties, and how to provide multiple configurations.
Leadership Election With Consul
Filed under Architecture, DevOps
Let’s see how Leadership Election with Consul helps to ensure data stability.
Java Weekly, Issue 347
Filed under Weekly Review
Efficient docker images for Spring Boot, lots of small upgrades for Spring, more patterns for distributed systems, and a historical take on date and time!
NoSuchMethodError in Java
Filed under Java
Let’s look at the java.lang.NoSuchMethodError and some ways to handle it.
What Is the Hi/Lo Algorithm?
Filed under Persistence
Learn how to the use Hi/Lo algorithm as a database identifier generation strategy.
Introduction to Spring Data Azure Cosmos DB
Filed under Cloud, Spring Data
Learn how to interact with Azure Cosmos DB using Spring Data.
What Is the Difference Between DVM and JVM?
Filed under JVM
Learn about the differences between the Java Virtual Machine (JVM) and the Dalvik Virtual Machine (DVM).
List All Classes Loaded in a Specific Class Loader
Filed under JVM
List all the classes loaded by a specific class loader in Java
Extracting Database Metadata Using JDBC
Filed under Persistence
Learn how to retrieve database metadata using a JDBC connection and the DatabaseMetaData interface.
Java Weekly, Issue 346
Filed under Weekly Review
A very diverse anthology: Project Amber’s design documents are already on GitHub, cloud functions in Micronaut, patterns for distributed systems, and advice for effective blogging.
How to Disable Spring Security Logout Redirects
Filed under Security, Spring Security
Take a close look at how to disable logout redirects in Spring Security.
Java Files Open Options
Filed under Java IO
Learn about the several options when opening files in Java.
Introduction to Spring Data JDBC
Filed under Spring Data
A quick and practical guide to Spring Data JDBC.
Set Field Value With Reflection
Filed under Java
Learn how to set values of private fields in Java using the Reflection API.
Difference Between request.getSession() and request.getSession(true)
Filed under Java Web
Understand the difference between calling HttpServletRequest#getSession() and HttpServletRequest#getSession(boolean).
Apache Maven Guide
Learn how to work with Apache Maven, the popular Java build automation tool
Spring @PathVariable Annotation
Filed under Spring MVC
When we need to extract values from the request URI, @PathVariable is the way to go. Let’s look how to use it.
Determine if an Object Is of Primitive Type
Filed under Core Java
Learn how to determine if an object is of primitive type using Java.
Java Weekly, Issue 345
Filed under Weekly Review
Microsoft continues to contribute to the Java ecosystem with new the OpenJDK for ARM and JMS over AMQP. Also, Patterns to manage distributed systems and finally, working effectively from home!
Flyway Repair With Spring Boot
Filed under Persistence, Spring Boot
Learn how to recover from a failed Flyway migration using Spring Boot.
XML Defined Beans in Spring Boot
Filed under Spring Boot, XML
Learn about XML defined beans in Spring Boot.
Skipping Tests With Gradle
In this short tutorial, we’ll see how to skip tests when using the Gradle build tool.
How to Implement a CNN with Deeplearning4j
Filed under Algorithms, Java
Learn how to build and train a convolutional neural network model using the Deeplearning4j library in Java.
When Are Static Variables Initialized in Java?
Filed under Core Java
Learn about the static variable initialization in Java.
Comparing Arrays in Java
Filed under Java Array
Have a look at different ways to compare arrays in Java.
Taking Screenshots Using Java
Filed under Java
Learn how to take screenshots using Java.
Preserving Line Breaks When Using Jsoup
Filed under XML
Learn different ways of preserving line breaks in HTML using Jsoup.
System.console() vs. System.out
Filed under Core Java
Learn about the differences between System.console() and System.out.
Setting Formulas in Excel with Apache POI
Filed under Java IO
Learn how to set and evaluate Excel formulas in Java with Apache POI
Using Mockito ArgumentCaptor
Filed under Testing
In this tutorial, we’ll cover a common use case of using Mockito ArgumentCaptor in our unit tests.
Guide to SDKMAN!
Filed under DevOps
Learn how to manage several versions of Java SDKs among other Java Ecosystem tools using SDKMAN!
Java Weekly, Issue 344
Filed under Weekly Review
Java is moving so fast! Java 15 is about to be released and we have two exciting news about Java 16. Also, some interesting topics on Security and Cloud.
Liskov Substitution Principle in Java
Filed under Java
The L in SOLID, the Liskov Substitution Principle helps structure object oriented design. We also explore how it supports the Open/Closed Principle.
Converting List to Map With a Custom Supplier
Filed under Java Collections
Learn several ways to convert a List into a Map using Custom Suppliers.
Java Weekly, Issue 343
Filed under Weekly Review
Another step for Project Loom in Java 15 and Deprecating Biased Locking, Cool topics on Cloud, Microservices, and Istio. And finally some OS classics!
Difference Between Statement and PreparedStatement
Filed under Java, Persistence
Explore the differences between JDBC’s Statement and PreparedStatement interfaces.
Java Weekly, Issue 342
Filed under Weekly Review
Lots of interesting topics in a wide range of topics: JVM internals, JUnit 5 tricks, Spring Profiles, Ktor, Infrastructure Costs, and a lot more.
Finding Top K Elements in a Java Array
Filed under Java Array
implement different solutions to the problem of finding the k largest elements in an array with Java
Reading the Value of ‘private’ Fields from a Different Class in Java
Filed under Java
Learn how to access the private fields of another class and read their values using the Java Reflection API.
Convert an Array of Primitives to a List
Filed under Java Array
Learn how to convert an array of primitives to a List of objects of the corresponding type.
Loading JDBC Drivers
Filed under Java, Persistence
Learn some of the basic steps needed to load JDBC drivers
YAML to List of Objects in Spring Boot
Filed under Spring Boot
Learn how to map a YAML list into a java List using Spring Boot.
Adding Text to an Image in Java
Filed under Java
Learn how to add text to images in Java
Converting a Java String Into a Boolean
Filed under Java String
Learn how to convert a string into a boolean using Java.
How to Resolve a Version Collision of Artifacts in Maven
Filed under Maven
Multi module maven projects can experience difficulties at compile time and runtime with multiple library versions. We learn how to control the versions used.
How Can I Resize an Image Using Java?
Learn how to resize (scale) an image using Java.
Division by Zero in Java: Exception, Infinity, or Not a Number
Filed under Java Numbers
When dividing by zero, integer division always throws an Exception. This is not the case with floating-point numbers, however. Let’s see why.
Java Weekly, Issue 341
Filed under Weekly Review
Lots of interesting writeups on a wide variety of topics: From new Spring improvement and Oracle Coherence to SOLID principles and freelancing.
How to Count the Number of Matches for a Regex?
Filed under Java
Regular expressions can help us with text processing. Here we explore how to count the number of matches of a regular expression in some text.
Print an Integer in Binary Format in Java
Filed under Java Numbers
Explore different ways of printing an integer in binary format in Java.
Mapping Collections with MapStruct
Filed under Java Collections
Explore how to map collections using MapStruct.
Java Weekly, Issue 340
Filed under Weekly Review
The Spring ecosystem is moving forward, with several major milestones. The Java language itself is also revisiting some core concepts as well. An interesting week.
Simple Single Sign-On with Spring Security OAuth2 (legacy stack)
Filed under Spring Security
A simple SSO implementation using Spring Security OAuth2 and Boot.
Inject a Map from a YAML File with Spring
Filed under Spring
Learn how to inject a Map from a YAML file in Spring Boot.
Getting MAC Addresses in Java
Filed under DevOps
Learn how to get the mac addresses of network card interfaces in Java.
Finding Unused Gradle Dependencies
Filed under Gradle
Learn how to use the Gradle Nebula Lint plugin to identify and fix unused dependencies in your project
How to Share DTO Across Microservices
Filed under Architecture
Learn ways in which DTOs are shared between microservices
Testing a Spring Multipart POST Request
Filed under Spring Web
Learn how to test a Spring Multipart POST Request using MockMvc with the help of an example.
The Covariant Return Type in Java
Filed under Java
Explore what the covariance and covariant return types are and how they behave in Java.
Java Heap Space Memory with the Runtime API
Filed under JVM
Learn how to access memory information of a JVM using the Java Runtime API.
Easy Ways to Write a Java InputStream to an OutputStream
Filed under Java IO
Learn how to write a Java InputStream to a Java OutputStream.
Java Weekly, Issue 339
Filed under Weekly Review
The Spring story on GraalVM is getting polish and Java 14 and even 15 features are getting some well-deserved attention. A solid week in the Java ecosystem.
Number Formatting in Java
Filed under Java Numbers
Learn to format numbers in Java.
Converting a Spring MultipartFile to a File
Filed under Spring Web
Learn to convert a Spring MultipartFile to a File.
Groovy Variable Scope
Filed under Groovy
Learn about variable scope in Groovy
WildFly Administration Remote Access
Filed under Jakarta EE
Learn how to expose the administrator console of WildFly for remote access.
Conditional CSS Classes in Thymeleaf
Filed under Spring MVC
Learn a few different ways to conditionally add CSS classes in Thymeleaf.
Testing Exceptions with Spring MockMvc
Filed under Spring MVC, Testing
Learn how to unit test controller exceptions using Spring MockMvc.
Redirecting Logged-in Users with Spring Security
Filed under Spring Security
Learn several ways how to redirect logged-in users from the login page using Spring Security.
Spring @RequestParam vs @PathVariable Annotations
Filed under Spring
Understand the differences between Spring’s @RequestParam and @PathVariable annotations.
Java Weekly, Issue 338
Filed under Weekly Review
This week is Spring-heavy, which is always cool 🙂 and, on top of that, a really solid writeup about building resilience. Good stuff.
Java IOException “Too many open files”
Filed under Java IO
Learn when and how to avoid the “Too many open files” exception in Java.
The Difference between RxJava API and the Java 9 Flow API
Filed under Reactive
Learn about the Reactive Stream Specification and see a practical example of Flow API and RxJava implementations for a live video stream
Test a Mock JNDI Datasource with Spring
Filed under Spring Persistence, Testing
Learn how to test a mock JNDI datasource using the Spring Framework and the Simple-JNDI library.
Testing @Cacheable on Spring Data Repositories
Filed under Spring Persistence
Learn how to isolate the caching layer in your Spring Data tests.
Writing IntelliJ IDEA Plugins Using Gradle
Learn how to write your own IntelliJ plugin using Gradle.
Spring YAML vs Properties
Filed under Spring
Compare the usage of Spring YAML versus the properties file.
When Does JPA Set the Primary Key
Filed under JPA
Learn about the different strategies JPA uses to generate the primary key for an entity and at which moment each strategy sets the key value during persistence.
Circular View Path Error
Filed under Spring Web
Learn about the Circular View Path error in a Spring Boot project.
Java Weekly, Issue 337
Filed under Weekly Review
Distributed caching, Kafka, and Spring Boot – the ecosystem is moving forward.
What Is [Ljava.lang.Object;?
Filed under Java Array
Learn what [Ljava.lang.Object; is and how to better print array objects.
The “Cannot find symbol” Compilation Error
Filed under Java
Review what compilation errors are, and then specifically explain what the “cannot find symbol” error is and how it’s caused.
Using Kafka MockProducer
Learn how to use Kafka’s MockProducer to verify common producer operations
Hibernate could not initialize proxy – no Session
Filed under Persistence
Learn how to handle org.hibernate.LazyInitializationException : could not initialize proxy – no Session in Java
Proxies With RestTemplate
Filed under HTTP Client-Side, REST
Learn how to send a request to a proxy using Apache’s RestTemplate in Java.
Java Weekly, Issue 336
Filed under Weekly Review
A nice intro to Amazon’s Deep Java Library for machine learning, and Spring Tools 4.6.2 is released.
Quick Guide to Spring Cloud Open Service Broker
Filed under Spring Cloud
Learn how to implement the Open Service Broker API using Spring Cloud Open Service Broker.
What Causes java.lang.OutOfMemoryError: unable to create new native thread
Filed under Java Concurrency
Learn about what causes the java.lang.OutOfMemoryError: unable to create new native thread error.
Partial Data Update With Spring Data
Filed under Spring Data
Learn techniques and approaches to performing a partial instead of a full update
Multi-Release JAR Files with Maven
Filed under Maven
Learn about Maven’s support for multi-release JAR files
Converting a BufferedReader to a JSONObject
Filed under JSON
Learn about JSONObject’s support for Readers
Casting int to Enum in Java
Filed under Java
Learn how to cast an int to an Enum in Java
Java Weekly, Issue 335
Filed under Weekly Review
An in-depth review of Apache Arrow’s in-memory data format for fast, machine-to-machine transfer of big data, and a migration guide for Spring Data JDBC 2.0.
Setting Custom Feign Client Timeouts
Filed under Spring Cloud
Learn how to set custom timeouts on the Spring Cloud’s Feign Client.
Using Kafka MockConsumer
Explore the MockConsumer, one of Kafka’s Consumer implementations
LinkedBlockingQueue vs ConcurrentLinkedQueue
Filed under Java Collections, Java Concurrency
Learn the difference between LinkedBlockingQueue and ConcurrentLinkedQueue in Java
Clicking Elements in Selenium using JavaScript
Filed under Testing
Learn how to click elements using Javascript in Selenium.
Open/Closed Principle in Java
Filed under Java
Explore the Open/Closed Principle (OCP) as one of the SOLID principles of object-oriented programming in Java.
Java Weekly, Issue 334
Filed under Weekly Review
A guide to switch expressions in Java 14, and a great article explains how developers can overcome their aversion to refactoring through deliberate practice.
Formatting Currencies in Spring Using Thymeleaf
Filed under Spring Web
Learn to format currencies in Spring using Thymeleaf.
Java Weekly, Issue 333
Filed under Weekly Review
A preview of Spring Boot support for GraalVM Native Images, and Spring Security and Boot release several new versions.
Transactional Annotations: Spring vs. JTA
Filed under Persistence, Spring
A quick and practical comparison of various @Transactional annotations.
Log4j 2 Plugins
Filed under Logging
Learn how to use the Log4j 2 extension mechanism to implement custom plugins
Foreign Memory Access API in Java 14
Filed under Core Java
Java 14 brings in a new API to wrap accessing memory managed outside of the JVM. Here we explore the need for the API and how it works.
Validate Phone Numbers With Java Regex
Filed under Java
Learn how to validate different formats of phone numbers using regular expressions.
Logout in an OAuth Secured Application (using the Spring Security OAuth legacy stack)
Filed under Spring Security
A practical deep-dive into how to implement logout in a Spring Security OAuth2 application with JWT, using Spring Security OAuth legacy stack.
How to Dynamically Autowire a Bean in Spring
Filed under Spring
Learn how to autowire beans dynamically given ceertain conditions.
Spring Cloud Gateway WebFilter Factories
Filed under Spring Cloud
Learn about Spring Cloud Gateway’s built-in WebFilter factories and how to use them in advanced scenarios
Spring Data Redis’s Property-Based Configuration
Filed under NoSQL, Spring Data
Learn how to configure Spring Boot to talk to Redis via Lettuce
Find Unused Maven Dependencies
Filed under Maven
Learn how to analyze unused dependencies in Maven using the Maven Dependency Plugin.
Manual Logout With Spring Security
Filed under Spring Security
Learn how to execute a manual logout with Spring Security.
Generate Database Schema with Spring Data JPA
Filed under Spring Data
JPA provides a standard for generating DDL from our entity model. Here we explore how to do this in Spring Data and compare that with native Hibernate.
Spring JPA @Embedded and @EmbeddedId
Filed under JPA
Learn how to use the @EmbeddeId and @Embeddable annotations to represent composite keys in JPA entities.
How to Add Proxy Support to Jsoup?
Filed under Data
Learn how to add proxy support to Jsoup
Asserting Log Messages With JUnit
Filed under Testing
Learn how to test log messages with JUnit
Building a Java Application With Gradle
Filed under Gradle
A quick and practical guide to building Java applications in Gradle.
Java Weekly, Issue 332
Filed under Weekly Review
Spring adopts new versioning schemes, and an in-depth look at Java’s new text blocks feature.
Single Responsibility Principle in Java
Filed under Java
A quick and practical guide to the Single Responsibility Principle in Java
Disable Security for a Profile in Spring Boot
Filed under Spring Security
A quick and practical guide to disabling Spring Security for a specific profile in Spring Boot.
Mapping Lists with ModelMapper
Filed under Java Collections
Learn how to map lists of different element types using Model Mapper.
Java Weekly, Issue 331
Filed under Weekly Review
A handful of Spring configuration tips for getting the most out of application.properties files, and Spring Tools 4.6.1 is released.
Using Multiple Cache Managers in Spring
Filed under Spring
Learn how we can enable multiple cache managers in our Spring Boot application.
Constructing a JPA Query Between Unrelated Entities
Filed under JPA
Learn to construct a JPA query between unrelated entities.
Spring Security Custom Logout Handler
Filed under Spring Security
Learn how to implement a Custom Logout Handler using Spring Security.
Building a Simple Web Application with Spring Boot and Groovy
Filed under Groovy, Spring Boot
Learn how to build a simple todo application with Spring Boot and Groovy.
Encode a String to UTF-8 in Java
Filed under Java String
Learn how to encode a Java String to the UTF-8 character set.
Mocking the ObjectMapper readValue() Method
Learn how to mock the Jackson ObjectMapper’s readValue method with Mockito.
The Difference Between mockito-core and mockito-all
Filed under Testing
Explore the difference between mockito-core and mockito-all.
How to Determine the Data Type in Groovy
Filed under Groovy
Explore different ways to find the data type in Groovy.
Java Weekly, Issue 330
Filed under Weekly Review
A quick look at building native images for Spring Boot apps with GraalVM, and a new series from Martin Fowler on source code branching patterns.
Oracle Connection Pooling With Spring
Filed under Spring Data
Learn how to setup connection pooling to an Oracle database with Spring Data
OAuth2 for a Spring REST API – Handle the Refresh Token in AngularJS (legacy OAuth stack)
Filed under Spring Security
We learned how to store the Refresh Token in an AngularJS client app, how to refresh an expired Access Token and how to leverage the Zuul proxy.
Hibernate Error “No Persistence Provider for EntityManager”
Filed under Persistence
A quick explanation and solution for the “No Persistence Provider for EntityManager” error.
Recommended Package Structure of a Spring Boot Project
Filed under Spring Boot
A quick and practical overview of a recommended package structure for Spring Boot projects.
The Map.computeIfAbsent() Method
Filed under Java Map
Learn the intricacies of the Map.computeIfAbsent method.
Handling java.net.ConnectException
Filed under Networking
Learn how to handle java.net.ConnectException
How to Test GraphQL Using Postman
Filed under Testing, Web Services
Learn about Postman’s support for GraphQL
Introduction to DBUnit
Filed under Testing
Learn how to set up database states for your unit tests using DBunit.
Writing Templates for Test Cases Using JUnit 5
Filed under Testing
Learn how to create a test template using JUnit 5.
How to Extract a Mono’s Content in Java
Filed under Reactive
Learn how to subscribe or block for a Mono’s promised value.
Convert String to Integer in Groovy
Filed under Groovy
Learn the several ways to convert from a String to an Integer in Groovy
Introduction to Mockito’s AdditionalAnswers
Filed under Testing
A quick and practical guide to Mockito’s AdditionalAnswers.
Java Map With Case-Insensitive Keys
Filed under Java Map
Learn about different Map implementations that accept all case variations of a String as the same key
Java Weekly, Issue 329
Filed under Weekly Review
A good intro to the new Kotlin DSL for Spring Integration, and a quick look at Java 14’s pattern-matching enhancement for the instanceof operator.
Spring Configuration Bootstrap vs Application Properties
Filed under Spring Boot, Spring Cloud
A quick overview of context hierarchies in Spring Cloud.
Spring MVC Data and Thymeleaf
Filed under Spring MVC
Learn the several ways that Spring MVC and Thymeleaf can work together to render data.
Guide to the Number Class in Java
Filed under Java Numbers
Learn what the Java Number class does and what methods it contains.
Java Weekly, Issue 328
Filed under Weekly Review
An overview of RSocket channels for bi-directional data streaming, and a deep dive into authentication and authorization in Spring Security.
Using Guava’s MapMaker
Filed under Java Map
Learn how to use Guava’s MapMaker class to create maps with weak references.
Conditional Flow in Spring Batch
Filed under Spring
Learn how to create Spring Batch jobs with conditional flow.
Introduction to Guava Throwables
Filed under Java
A quick and practical introduction to Guava Throwables.
Helpful NullPointerExceptions in Java 14
Filed under Java
Learn about helpful NullPointerExceptions in Java 14.
Intro to Coroutines with Quasar
Filed under Java Concurrency
Learn to implement coroutines in Java using Quasar.
Add BigDecimals using the Stream API
Filed under Java Numbers
While the streams API provides a useful way to calculate the sum of some numeric types, BigDecimal is not support. Here we learn how to calculate sums with reduce.
Returning Plain HTML From a Spring MVC Controller
Filed under Spring MVC
Learn how to return HTML from a Spring MVC controller.
Difference Between BeanFactory and ApplicationContext
Filed under Spring
Learn about the significant differences between Spring’s ApplicationContext and BeanFactory with practical examples
How to Determine Day of Week by Passing Specific Date in Java?
Filed under Java Dates
A quick and practical guide to determining the day of the week in Java.
Java Weekly, Issue 327
Filed under Weekly Review
A preview of Kubernetes support coming to Spring Boot 2.3, and a handful of Google Cloud tools to help you build and deploy Spring Boot microservices.
The Clear-Site-Data Header in Spring Security
Filed under Spring Security
Learn how to use Spring Security’s with ClearSiteDataHeaderWriter to add the HTTP Clear-Site-Data response header
Fixing “constant string too long” Build Error
Filed under Java String
Learn to fix the “constant string too long” build error in Java.
Prevent ApplicationRunner or CommandLineRunner Beans From Executing During Junit Testing
Learn how to prevent ApplicationRunner or CommandLineRunner beans from executing during JUnit tests.
Gradient Descent in Java
Filed under Algorithms, Data
Learn about Gradient Descent in Java and why backtracking is so important.
Java Weekly, Issue 326
Filed under Weekly Review
An overview of the RSocket request-stream messaging model, and a quick guide to writing a controller for Kubernetes clusters in Java using the Fabric8 API.
Introduction to Lock Striping
Filed under Java Concurrency
Learn the key differences between coarse-grained synchronization and fine-grained synchronization and how to implement them in Java.
Spring REST API + OAuth2 + Angular (using the Spring Security OAuth legacy stack)
Filed under Spring Security
Learn how to set up OAuth2 for a Spring REST API and how to consume that from an Angular client.
Keycloak Embedded in a Spring Boot Application
Filed under Security, Spring Boot
Learn how to set up a pre-configured embedded Keycloak server that can be booted up within a Spring Boot application.
L-Trim and R-Trim Alternatives in Java
Filed under Java String
Learn several methods how to achieve l-trim and r-trim in java.
IntelliJ – Cannot Resolve Spring Boot Configuration Properties Error
IntelliJ can provide autocomplete and context help for custom properties, but we need to make some additional configuration to our project to enable that.
Compare Two JSON Objects with Gson
Filed under JSON
Comparison of JSON in its string representation is often less effective than comparing it semantically. Here we use Gson to load the JSON and compare the data.
Java Weekly, Issue 325
Filed under Weekly Review
A handful of tips for getting the most out of Java 14 with Spring, and a good overview of the RSocket protocol’s fire-and-forget messaging.
Guide to the Java Authentication And Authorization Service (JAAS)
Learn about the JAAS security framework that augments the security model from code-based security to user-based security
Using NullAway to Avoid NullPointerExceptions
Filed under Java
Learn how to avoid NullPointerExceptions using NullAway.
Java Weekly, Issue 324
Filed under Weekly Review
A simple RSocket client built using Spring Shell and Spring Boot, and a deep dive into writing command-line tools in Java using GraalVM and the Picocli library.
Could Not Reserve Enough Space for Object Heap
Filed under JVM
Learn the possible causes for the “Could Not Reserve Enough Space For Object Heap” error and how to solve it.
Injecting a Value in a Static Field in Spring
Filed under Spring
Learn how to inject a value into a static field in Java
Introduction to Apache Beam
Filed under Data
Get started with Apache Beam and this simple word counter
Finding the Spring Version
Filed under Spring
Learn how to obtain the JDK, Java and Spring versions
Capturing a Java Thread Dump
Filed under Java Concurrency
Learn how to capture a Java thread dump
Testing Spring Boot @ConfigurationProperties
Filed under Spring Boot, Testing
Learn how to test configuration classes in Spring Boot that rely on the @ConfigurationProperties annotation.
Java Weekly, Issue 323
Filed under Weekly Review
An intro to the RSocket messaging protocol for microservices, and a good write-up on the Kotlin-based Ktor framework for client and server development.
Connect Java to a MySQL Database
Filed under Spring Persistence
Learn several techniques to connect to a MySQL database from Java.
ThreadPoolTaskExecutor corePoolSize vs. maxPoolSize
Filed under Java Concurrency
Learn about the corePoolSize and maxPoolSize properties in the ThreadPoolTaskExecutor.
Converting Gradle Build File to Maven POM
Learn to convert a Gradle build file to a Maven pom.xml.
Exponential Backoff With Spring AMQP
Filed under Spring
Explore two different ways of implementing a message sending retry strategy named Exponential Backoff.
Java Weekly, Issue 322
Filed under Weekly Review
A solid overview of the Quarkus container-first framework for Java, and Spring Core Framework has a couple of new releases.
How to Lock a File in Java
Filed under Java IO
Learn about different file locking techniques using the Java NIO Library.
Swagger @ApiParam vs @ApiModelProperty
Filed under REST
Learn the difference between Swagger’s @ApiParam and @ApiModelProperty
Using JSON Patch in Spring REST APIs
Filed under JSON, Spring MVC
Learn how to use the HTTP PATCH method along with the JSON Patch document format to apply partial updates to RESTful resources
Modifying the Response Body in a Zuul Filter
Filed under Cloud, Spring Cloud
Learn about the Netflix Zuul’s post filter.
Java Weekly, Issue 321
Filed under Weekly Review
Spring’s new website sports a fresh, clean design, and an exercise in optimizing a Java method with an eye toward minimizing its bytecode footprint.
How to Handle Java SocketException
Filed under Java
Learn what causes SocketException in Java and how to handle it.
Cache Headers in Spring MVC
Filed under Spring MVC
Learn about HTTP caching by using the Cache-Control response header in Spring MVC.
Spring Projects Version Naming Scheme
Filed under Spring Boot
Learn about the naming schemas in Spring.
Java Weekly, Issue 320
Filed under Weekly Review
A deeper dive into the Java records preview feature, and the first JDK 14 Release Candidate is announced.
Intro to OpenCV with Java
Filed under Java
Learn how leverage OpenCV with Java
Guide to AVL Trees in Java
Filed under Algorithms
Learn about AVL Trees and algorithms for inserting, deleting, and searching for values
Case-Insensitive String Matching in Java
Filed under Java String
Learn how to perform case-insensitive String matching in Java.
Java Weekly, Issue 319
Filed under Weekly Review
A couple of write-ups on the Java Records preview feature in Java 14, and a great introductory guide to Spring Framework.
Difference Between Java Matcher find() and matches()
Filed under Java
Learn about the differences between the find() and matches() methods of the Matcher class.
Java Weekly, Issue 318
Filed under Weekly Review
A sneak peek at improved Docker support coming to Spring Boot, and a collection of cool plugins for IntelliJ IDEA.
Final vs Effectively Final in Java
Filed under Core Java
Learn the difference between Final and Effectively Final in Java.
java.net.UnknownHostException: Invalid Hostname for Server
Filed under Networking
Learn what causes UnknownHostException, how to prevent it, and how to handle it.
Guide to the Cactoos Library
Filed under Java
Explore the Cactoos library and some of the classes it provides for string and data structure manipulation.
Parsing Command-Line Parameters with Airline
Filed under Java
Learn how to parse command-line parameters with Airline
Guide to @CurrentSecurityContext in Spring Security
Filed under Spring Security
Reading from the Spring Security Context can require a bit of boilerplate code. With the @CurrentSecurityContext annotation we can inject the values we need.
Working with Lazy Element Collections in JPA
Filed under JPA
Learn how to work with lazy collection in JPA.
Guide to Work Stealing in Java
Filed under Java Concurrency
Learn about work stealing in Java.
Balanced Brackets Algorithm in Java
Filed under Algorithms, Java
Learn how to address the problem of Balanced Brackets, also known as Balanced Parentheses, with Java.
List All Available Redis Keys
Filed under Persistence
Learn how to list all of the available Redis keys
Introduction to Jsoniter
Filed under JSON
Learn how to parse JSON with Jsoniter (json-iterator)
Java Weekly, Issue 317
Filed under Weekly Review
An intro to the Reactive programming support in several high-profile Spring projects, and several new releases are out for Spring Boot and Core.
What Causes java.lang.reflect.InvocationTargetException?
Filed under Java
Learn what Causes java.lang.reflect.InvocationTargetException.
Java Weekly, Issue 316
Filed under Weekly Review
A deep dive into coroutines in Kotlin, and a guide to the RFC-7807 standard for communicating API problems to client applications.
Introduction to Big Queue
Filed under Java Collections
Learn about the Big Queue, a Java implementation of a persistent queue.
Java Preview Features
Filed under Core Java
A quick and practical overview of Java preview features.
Generating Random Numbers in Java
Filed under Java Numbers
Learn different ways of generating random numbers in Java.
Partitioning and Sorting Arrays with Many Repeated Entries with Java Examples
Filed under Java Array
Learn different ways to partition and sort an array containing many repeated entries.
Obtaining a Power Set of a Set in Java
Filed under Algorithms, Java Collections
Study the process of generating a power set of a given set in Java.
Java Weekly, Issue 315
Filed under Weekly Review
An overview of installing and managing multiple Java SDKs with SDKMAN!, and a collection of patterns for building an observability pipeline for microservices.
Introduction to Greedy Algorithms with Java
Filed under Algorithms
Learn about greedy algorithms in the Java ecosystem.
Read Excel Cell Value Rather Than Formula With Apache POI
Filed under Java IO
Learn about different ways to read Excel cell values rather than the formula using Apache POI
Java Do-While Loop
Filed under Core Java
A quick and practical guide to Java while loops
Java For Loop
Filed under Core Java
A quick and practical guide to Java for loops
Using Cookies With Selenium WebDriver in Java
Filed under Testing
Learn how to use cookies with Selenium WebDriver in Java
Convert Double to Long in Java
Filed under Java Numbers
Explore various methods to convert from double to long in Java
Apache RocketMQ with Spring Boot
Filed under Data, Spring Boot
Learn how to use Apache RocketMQ with Spring Boot.
Specify an Array of Strings as Body Parameters in Swagger
Filed under Spring
Learn how to produce a default example value for String arrays as this behavior is not enabled by default.
How to Return Multiple Values From a Java Method
Filed under Java
Some programming languages provide easy ways to return multiple values from a method. In Java, there are a few similar options, depending on the types.
Guide to the Java finally Keyword
Filed under Core Java
Java’s finally keyword is helpful for clean-up operations around code that may throw errors. We explore how it works and when it can have unexpected behaviour.
Java Weekly, Issue 314
Filed under Weekly Review
A new year for the Java Weekly begins with a solid write-up on detecting JVM memory leaks and a hard look at the JShell REPL for Java.
Arrays.sort vs Arrays.parallelSort
Filed under Java Array
Learn how Java sort() and parallelSort() differ.
Spring Security and OpenID Connect (Legacy)
Filed under Spring Security
Learn how to set up OpenID Connect (from Google) with a simple Spring Security application.
Java Weekly, Issue 313
Filed under Weekly Review
A complete list of features selected for the Java 14 release, and a great write-up on automatic conflict resolution for concurrent applications.
Bitwise & vs Logical && Operators
Filed under Core Java
Learn the difference between & and && in Java
Using the Not Operator in If Conditions in Java
Filed under Core Java
Inverting logical expressions can make your code clearer, and is an important part of using Java. Here are some tricks to master and pitfalls to avoid.
How to Set the JVM Time Zone
Filed under JVM
Learn about several ways we can modify the time zone of the JVM using Java.
Quick Guide to the Java Stack
Filed under Java Collections
A quick and practical guide to common operations of the java.util.Stack.
Get Substring from String in Java
Filed under Java String
The practical ways of using the useful substring functionality in Java – from simple examples to more advanced scenarios.
Guide to WebRTC
Filed under HTTP Client-Side
Learn how to build a direct, real-time communication channel between two browsers, mobile apps, or other HTML clients using WebRTC.
A Quick Guide to Post Requests with OkHttp
Filed under HTTP Client-Side, Java
Learn about the different features OkHttp has for POST requests.
Guide to the AuthenticationManagerResolver in Spring Security
Filed under Spring Security
Learn how to use Spring Security’s AuthenticationManagerResolver for Basic and OAuth2 authentication flows
Wrapping vs Rethrowing Exceptions in Java
Filed under Java
Explore the main difference between re-throwing the original exception vs first wrapping it.
Java Weekly, Issue 312
Filed under Weekly Review
An intro to Resilience4j, inspired by Hystrix, and a good presentation on surviving Spring Cloud’s migration away from the Netflix stack.
Maximum Subarray Problem in Java
Filed under Algorithms, Java Array
Discover two approaches for solving the maximum subarray problem using Java.
Java Weekly, Issue 311
Filed under Weekly Review
The future of Java, a look at the Spring Framework maintenance roadmap for 2020, and a great article on CPU cache performance.
Overview of Combinatorial Problems in Java
Filed under Algorithms
Learn algorithms for solving a few common combinatorial problems and how to implement them in Java.
Check if Two Strings Are Anagrams in Java
Filed under Java String
We may wish to detect whether Strings contain anagrams of each other. Here we explore a few algorithms, with different programming and execution complexity.
Prim’s Algorithm with a Java Implementation
Filed under Algorithms
Learn how Prim’s algorithm works and how to implement it in Java.
Java Weekly, Issue 310
Filed under Weekly Review
Keeping the data you expose separate from the data you store, new GCs in Java and my new OAuth2 course.
Fibonacci Series in Java
Filed under Algorithms
Learn how to generate terms of the Fibonacci series in Java
How to Implement a Quarkus Extension
Filed under DevOps
Learn how to implement a Quarkus extension
Handling URL Encoded Form Data in Spring REST
Learn how to handle URL encoded form data in Spring REST
Circular Linked List Java Implementation
Filed under Java Collections
Learn how to implement a circular linked list in Java.
Spring MVC Themes
Filed under Spring MVC
Learn how to apply and manage themes with Spring MVC
Checking if Two Java Dates Are on the Same Day
Filed under Java Dates
Learn several different ways to check if two Date objects have the same day.
Why I’m Breaking Up My “Learn Spring Security” Course?
Filed under Spring Security
Why I decided to split my “Learn Spring Security” course into two separate courses.
Java Weekly, Issue 309
Filed under Weekly Review
An intro to the Lambda DSL for Spring Security, and a quick technical overview of the California Consumer Privacy Act (CCPA), which takes effect January 1.
JPA/Hibernate Persistence Context
Filed under JPA
Learn about Persistence Context with Hibernate
Basic Calculator in Java
Filed under Algorithms
Learn how to implement a Basic Calculator in Java, using two different constructs.
WebSockets with the Play Framework and Akka
Filed under Java Web
WebSockets allow continuous communication between a client app and its server. This can be built with reactive streams in Akka and the Play Framework.
Spring Optional Path Variables
Filed under Spring MVC
Explore how to make a path variable optional in different Spring versions.
Java Weekly, Issue 308
Filed under Weekly Review
The Spring Security OAuth story is continuing, a new JVM TI agent that can detect an unhealthy JVM, plus an overview of Java versions, features, and distributions.
Get the Current Date Prior to Java 8
Filed under Java Dates
Learn how to get the current Date in Java using several techniques prior to Java 8.
Is It a Bad Practice to Catch Throwable?
Filed under Java
Find out if it is a bad practice to catch Throwable.
What Is a Pojo Class?
Filed under Java
Knowing the difference between a POJO and a JavaBean may be the key to unlocking the potential of our classes in core Java.
Determine the Execution Time of JUnit Tests
Filed under Testing
Knowing the time taken by our automated tests can be helpful in pin-pointing issues, or optimising our builds. There are a few ways to view our test execution reports.
Java Weekly, Issue 307
Filed under Weekly Review
A look at the MultipleBagFetchException in Hibernate, and a tutorial on externalizing Spring Boot configuration properties.
Skipping Weekends While Adding Days to LocalDate in Java 8
Filed under Java Dates
Learn how to add days to Java 8’s LocalDate whilst skipping weekends
Guide to Flash Attributes in a Spring Web Application
Filed under Spring MVC
Learn how to use Spring’s flash attributes to implement the Post/Redirect/Get form submission workflow.
Documenting a Spring REST API Using OpenAPI 3.0
Learn how to generate OpenAPI 3.0 specifications for a Spring REST API using SpringDoc.
The Bridge Pattern in Java
Filed under Java
A guide to the bridge design pattern and its Java implementation
FetchMode in Hibernate
Filed under Persistence
Learn how to use FetchMode in Hibernate.
How to Determine if a Binary Tree Is Balanced in Java
Filed under Algorithms
Learn how to determine if a binary tree is balanced in Java.
Reading HttpServletRequest Multiple Times in Spring
Filed under Jackson, Spring MVC
Learn how to read Spring’s HttpServletRequest multiple times
Java Weekly, Issue 306
Filed under Weekly Review
A deep dive into local variable type inference first made available in Java 10, and Azure Spring Cloud is now in public beta.
Hibernate Error “Not all named parameters have been set”
Filed under Persistence
Learn what causes the Hibernate error “Not all named parameters have been set” and how to avoid it.
Scanner nextLine() Method
Filed under Java IO
Learn about Java’s Scanner.nextLine method using some simple examples
Guide to ParameterMessageInterpolator
Filed under Jakarta EE
Learn how to use ParameterMessageInterpolator and how to configure it in Hibernate Validator
Java Weekly, Issue 305
Filed under Weekly Review
An in-depth look at the internals of Integer types in the JVM, and a lesson on the importance of access control in cloud data encryption.
Generating Random Dates in Java
Filed under Java Dates
Learn how to generate random dates in Java
Customizing the Result of JPA Queries with Aggregation Functions
Filed under JPA, Spring Data
Spring Data JPA has some useful tricks for mapping the results of aggregation queries to custom objects, rather than the default object arrays.
Converting Java Date to OffsetDateTime
Filed under Java Dates
Learn how to convert a Java Date to an OffsetDateTime.
Testing a Spring Batch Job
Explore various approaches to test a Spring Batch job.
Java Weekly, Issue 304
Filed under Weekly Review
An under-the-hood look at Project Valhalla’s prototype for inline classes in Java, and an overview of Spring Cloud Stream’s functional and reactive support.
JPA Annotation for the PostgreSQL TEXT Type
Filed under JPA
Learn how to manage the PostgreSQL TEXT type using the annotations defined by the JPA specification.
Knapsack Problem Implementation in Java
Filed under Algorithms, Java
Learn how to solve the Knapsack problem in Java.
Guide to Tomcat Manager Application
Filed under DevOps
Learn how to use the Tomcat Manager App – a web application packaged with the Tomcat server for managing our deployed web applications.
Transaction Propagation and Isolation in Spring @Transactional
Filed under Persistence, Spring Data
Learn about the isolation and propagation settings in Spring’s @Transactional
Java ‘protected’ Access Modifier
Filed under Core Java
The protected modifier helps Java classes to encapsulate their implementation and also share it with related types. Explore how this modifier works in practice.
Adding an Element to a Java Array vs an ArrayList
Filed under Java Collections
Learn how to add an element to a Java Array vs an ArrayList
Spring @ComponentScan – Filter Types
Filed under Spring
Explore different types of filter options available with the @ComponentScan annotation.
Transaction Support in Spring Integration
Filed under Spring Persistence
Learn about transaction support in the Spring Integration framework including how to synchronize the transaction with operations on a nontransactional resource
Java Weekly, Issue 303
Filed under Weekly Review
A couple of good intro articles on Spring Cloud Stream, and a promising new data synchronization platform from Netflix. Plus, Boot 2.2.
Java Application Remote Debugging
Explore how to use JDWP together with JDB, both JDK tools.
Design Patterns Series
A practical and comprehensive look at learning design patterns in Java.
Digital Signatures in Java
Filed under Security
Java provides support for digital signature via the JCA APIs. See how to digitally sign and verify messages with public/private key cryptography.
Simultaneous Spring WebClient Calls
Filed under HTTP Client-Side, Reactive, Spring Web
Learn how to make simultaneous HTTP requests using The Spring WebClient.
Java Weekly, Issue 302
Filed under Weekly Review
A breakdown of the top new features in Spring Data Moore, and a new series on JavaFX is ramping up.
The State of Java in 2019
Java 8 is still the king, Kotlin is growing like crazy and Spring is almost equivalent to Spring Boot now. The 2019 “State of Java” survey results are out!
Hibernate @WhereJoinTable Annotation
Filed under Persistence
Hibernate allows querying according to columns within the relation table in a many-to-many relationship. This is achieved with the WhereJoinTable annotation.
The Java File Class
Filed under Java IO
Learn how to use the Java File Class.
Intro to the Java SecurityManager
Filed under Security
A quick and practical overview of Java SecurityManager.
Using Enums as Request Parameters in Spring
Filed under Spring MVC
Learn how to use enums as request parameters in Spring REST controllers and how to handle exceptions triggered by invalid input.
Integrating Spring with AWS Kinesis
Learn how to integrate Spring with two AWS libraries for interacting with Kinesis Data Streams
Excluding URLs for a Filter in a Spring Web Application
Filed under Spring MVC
Learn how to exclude URLs from being executed in Spring Web filters. A bit advanced but highly highly useful.
Java Weekly, Issue 301
Filed under Weekly Review
A host of major new releases for Spring, a cool new series on using GraphQL in Java and Datadog is back.
Spring Security – Attacking OAuth
Filed under Spring Security
Explore an OAuth attack based on redirection URLs and how to mitigate them with absolute URL matching.
Flogger Fluent Logging
Filed under Logging
Learn how to use the Flogger framework as an alternative for the traditional logging frameworks.
Mocking a WebClient in Spring
Mocking the fluent Spring WebClient interface for testing is possible but hard work. MockWebServer is an easy to use alternative.
How to Change the Java Version in an IntelliJ Project
Filed under IDE
A quick and practical overview of how to change the Java version in an IntelliJ project.
Authentication with HttpUrlConnection
Filed under Security
Learn how to authenticate HTTP requests using HttpUrlConnection.
Grouping Jakarta (Javax) Validation Constraints
Filed under Jakarta EE
A quick and practical overview of grouping Javax validation constraints.
Parsing an XML File Using SAX Parser
Filed under XML
Learn how to parse an XML file in Java using SAX Parser.
Graceful Shutdown of a Spring Boot Application
Filed under DevOps, Spring Boot
Shut down a Spring Boot application gracefully.
Java Weekly, Issue 300
Filed under Weekly Review
Issue 300 🙂 An overview of Maven archetypes and alternatives for project scaffolding, and a look at best practices for implementing TestProject.
Using Multiple Source Objects with MapStruct
Filed under Java
Learn how to use multiple source objects with MapStruct.
Spring Validation Message Interpolation
Filed under Spring
Learn how default Spring message interpolation works and how to create a custom message interpolation engine
Java Weekly, Issue 299
Filed under Weekly Review
A guide to the new Java 13 language features, API improvements, and JVM enhancements, plus a promising new series on enterprise testing efficiency.
Convert XML to HTML in Java
Filed under XML
Learn several ways to convert XML to HTML in Java.
Repositories with Multiple Spring Data Modules
Filed under Spring, Spring Data
Learn several ways how to configure multiple data modules in your Spring Application.
Create a File in a Specific Directory in Java
Filed under Java IO
Learn how to create a file in a specific directory using absolute and relative file paths
Get Started with Java
Learn the basics of the Java programming language
Java Weekly, Issue 298
Filed under Weekly Review
The 2019 “State of Java ” Survey has started.
OCP Certification – Advanced Java Class Design
Filed under Java
Learn some tips on common aspects of the OCP Certification exam.
Difference between context:annotation-config vs context:component-scan
Filed under Spring
Explore the differences between context:annotation-config and context:component-scan XML elements.
How to Compress Requests Using the Spring RestTemplate
Filed under HTTP Client-Side, REST, Spring
Learn how to create an interceptor for a RestTemplate that compresses the content of a request.
Debugging the Spring MVC 404 “No mapping found for HTTP request” Error
Filed under Spring MVC
Learn how to fix common causes for 404 errors in Spring MVC
Guide to System.gc()
Filed under Core Java
Learn about the System.gc() method understand if there are any use cases when calling this method might be useful
Java – “Could Not Find or Load Main Class” Error
Filed under Java
Explore the reasons for the error “Could not find or load main class” and learn how to avoid them.
Java Copy Constructor
Filed under Core Java
Here’s how to create copy constructors in Java and why to implementing Cloneable isn’t such a great idea.
Generating Random Numbers in a Range in Java
Filed under Java Numbers
Learn about alternative ways of generating random numbers within a range in Java.
Listing Numbers Within a Range in Java
Filed under Java Numbers
Explore various ways of generating random numbers within a range in Java.
A Guide to the Java FileReader Class
Filed under Java IO
Learn about the basic concepts of a Reader and how FileReader makes it simple to do read operations on text files though some examples.
Logging Spring WebClient Calls
Learn how to log Spring WebClient calls, useful for auditing and debugging.
Removing an Element From an ArrayList
Filed under Java Collections
Learn several ways to remove an element from an ArrayList in Java.
Intro to DataStax Java Driver for Apache Cassandra
Filed under NoSQL
Learn how to work with Cassandra databases using the DataStax Java Driver for Apache Cassandra.
Java Weekly, Issue 297
Filed under Weekly Review
A preview of candidate JEPs to support records and sealed types, and a good write-up about the costs associated with avoiding different types of lock-in.
Java ‘private’ Access Modifier
Filed under Core Java
Learn all about the ‘private’ access modifier in Java.
Java ‘public’ Access Modifier
Filed under Core Java
Learn how to best use the Java ‘public’ Access Modifier
Parsing an XML File Using StAX
Filed under XML
Learn how to parse an XML File using StAX
Building Java Applications with Bazel
Filed under DevOps
Learn how to build Java applications using the Bazel build tool.
Spring Cloud Tutorial
Filed under Series, Spring Cloud
Learn Spring Cloud including concepts, additional libraries and examples for distributed systems.
Java Weekly, Issue 296
Filed under Weekly Review
A look at how Clojure’s minimal syntax gives it a leg up over syntax-heavy languages like Java for building large systems.
FreeMarker Common Operations
Filed under Jakarta EE
Check out the most common features in FreeMarker.
Checked and Unchecked Exceptions in Java
Filed under Java
Learn the differences between Java’s checked and unchecked exception with some examples
A Guide to System.exit()
Filed under Core Java
Learn how and when to use the Java System.exit() function.
Counting Words in a String with Java
Filed under Java String
Learn several ways to count words in a Java String.
Run a Java main Method Using Gradle
Filed under Gradle
Learn different methods of executing a Java main method using Gradle
Java Weekly, Issue 295
Filed under Weekly Review
A guide to creating secure services using Spring Cloud Gateway, and a cool presentation on Serverless Java.
Calling Default Serializer from Custom Serializer in Jackson
Filed under Jackson
Learn how to call Jackson’s default serializers within a custom serializer.
Validating Lists in a Spring Controller
Filed under REST, Spring MVC
Learn how to validate a List of objects as a parameter to a Spring Controller
Finding the Least Common Multiple in Java
Filed under Algorithms, Java
Learn various methods to find the least common multiple of two numbers in Java
Implementing the Oauth 2.0 Authorization Framework Using Jakarta EE
Filed under Jakarta EE, Security
This article shows an example of implementing the OAuth2 Authorization Framework using Java EE and MicroProfile.
Debugging with Eclipse
Filed under IDE
Have a look at some useful tips and tricks for debugging Java programs using Eclipse
Interpolation Search in Java
Filed under Algorithms
Learn about the interpolation search algorithms and discuss their pros and cons.
Java String equalsIgnoreCase()
Filed under Java String
Learn how to check if two String values are the same when we ignore case.
Guide to In-Place Sorting Algorithm Works with a Java Implementation
Filed under Algorithms
Learn how the in-place sorting algorithm works.
Calculating Logarithms in Java
Filed under Algorithms
Learn several ways to calculate logarithms in Java.
Java Weekly, Issue 294
Filed under Weekly Review
A round-up of all the new language features that have come out since Java 8, with a special focus on local-variable type inference via the var keyword.
Finding Greatest Common Divisor in Java
Filed under Algorithms
Learn several ways to find the Greatest Common Divisor in Java.
Find the Number of Lines in a File Using Java
Filed under Java IO
Learn how to find the number of lines in a file using Java.
Evaluation of Methods References in Java
Filed under Core Java
Learn about Evaluation of Methods References in Java
Thymeleaf lists Utility Object
Filed under Spring Web
Learn how to use the Thymeleaf lists Utility Object
Java ‘Hello World’ Example
Filed under Java
Learn how to write, compile, and execute a basic ‘Hello World’ program in Java.
Javax BigDecimal Validation
Filed under Java Numbers
A quick and practical overview of BigDecimal validation using Javax.
Java Weekly, Issue 293
Filed under Weekly Review
A handful of new Spring releases, including Spring Core, Boot, and Security, and the end-of-life for Spring Boot 1.x is announced.
Automatic Generation of the Builder Pattern with FreeBuilder
Filed under Java
Learn how to generate Java builder objects using the FreeBuilder library
Binary Numbers in Java
Filed under Java Numbers
Learn how to convert binary numbers into decimal ones and vice versa.
A Guide to Increment and Decrement Unary Operators in Java
Filed under Core Java
Explore the increment and decrement unary operators in Java.
Convert String to Double in Java
Filed under Java String
Explore many ways of converting a String into a double in Java.
Modifying an XML Attribute in Java
Filed under XML
Learn how to modify attributes in an XML document using Java with JAXP, dom4j, and jOOX
Spring WebClient Filters
Filed under HTTP Client-Side, Spring Web
Learn about WebClient filters in Spring WebFlux
Depth First Search in Java
Filed under Algorithms
A guide to the Depth-first search algorithm in Java, using both Tree and Graph data structures.
Guide to @SpringBootConfiguration in Spring Boot
Filed under Spring Boot
Learn about @SpringBootConfiguration’s usage in a Spring Boot Application
The Difference between getRequestURI and getPathInfo in HttpServletRequest
Filed under Jakarta EE
Learn the difference between Java EE’s HttpServletRequest getRequestURI() and getPathInfo() methods
Mapping Entity Class Names to SQL Table Names with JPA
Filed under JPA
Learn how table names are generated by default and how to override that behavior.
Java Weekly, Issue 292
Filed under Weekly Review
The Java shell, better NPE debugging and being careful what dependencies you’re pulling into your project. Good stuff.
Reloading Properties Files in Spring
Filed under Spring Cloud
Learn a few approaches to getting property values to reload in Spring Beans, including Spring Cloud’s refresh scope.
Functional Controllers in Spring MVC
Filed under Spring MVC
Spring MVC controllers can now be written in a new functional style. Explore this new pattern, bringing the benefits of functional programming to blocking code.
Shell Sort in Java
Filed under Algorithms
Learn how to implement Shell Sort algorithm in Java.
String toLowerCase and toUpperCase Methods in Java
Filed under Java String
Learn about Java’s String toUpperCase and toLowerCase methods
Checking if a URL Exists in Java
Filed under HTTP Client-Side
Learn how to check if a URL exists in Java using the GET and HEAD HTTP methods
Java Weekly, Issue 291
Filed under Weekly Review
A cool library for gathering ORM metrics and testing ORM behavior, and Apache NetBeans 11.1 is released as a top-level project.
Checking If an Array Is Sorted in Java
Filed under Java Array
Learn how to check if an array is sorted in Java.
Looping Diagonally Through a 2d Java Array
Filed under Algorithms, Java Array
Learn how to loop diagonally in a 2d array in Java.
Concatenate Strings with Groovy
Filed under Groovy
Learn how to concatenate Strings using Groovy.
Transferring a File Through SFTP in Java
Filed under Java IO
Have a look at a few Java libraries that allow you to upload and download files through STFP.
Get the Current Working Directory in Java
Filed under Java IO
Learn different ways to retrieve the current working directory in Java.
The Proxy Pattern in Java
Filed under Java
A guide to the Proxy design pattern and its Java implementation
Java Weekly, Issue 290
Filed under Weekly Review
A guide to enabling Preview Features in Java’s early-release builds, and a report on the current state of technology adoption in the Java space.
Upload and Retrieve Files Using MongoDB and Spring Boot
Filed under NoSQL, Spring Boot
Have a look at how to upload files of different sizes using Spring Boot and MongoDB.
JUnit Custom Display Name Generator API
Filed under Testing
Learn how to use JUnit Custom Display Name Generator API to create Test Display Names.
Guide to Spring Cloud Stream with Kafka, Apache Avro and Confluent Schema Registry
Filed under Spring Cloud
Make Spring Cloud support Kafka with the Confluent standard components and approach, including Avro, the Schema Registry and the standard binary message format.
Compare Two JSON Objects with Jackson
Learn how to use Jackson to compare two JSON objects using the built-in comparator and a custom comparator
Adding Copyright License Header for Java Source Files in Eclipse
Filed under IDE
Putting copyright messages at the top of source files is easy with these tools in the Eclipse IDE.
Java Weekly, Issue 289
Filed under Weekly Review
A new explore-the-project option is available on Spring Initializr, and a guide to making Kotlin code easier to read through the use of scope functions.
Disable Spring Data Auto Configuration
Filed under Spring Boot, Spring Data
Learn the two ways to disable Spring Boot’s auto-configuration for Spring Data
Removing an Element from an Array in Java
Filed under Java Array
Removing an element from an array in Java doesn’t change the size of the array. Learn why.
The Spring @Qualifier Annotation
Filed under Spring
@Autowired alone isn’t sometimes enough to disambiguate dependencies. You can wire more exactly using the @Qualifier annotation. @Primary can also help.
The Java SecureRandom Class
Filed under Security
Learn how to use the SecureRandom class in Java and how to produce safe random numbers.
A Guide to Apache Mesos
Filed under Architecture
Learn how Apache Mesos addresses problems of resource allocation within applications deployed on the same cluster
A Guide to NanoHTTPD
Filed under REST
Explore an open-source, lightweight, web server written in Java – NanoHTTPD.
Setting the MySQL JDBC Timezone Using Spring Boot Configuration
Filed under Persistence, Spring Boot, Spring Data
Learn how to directly set the timezone for a MySQL JDBC Connection via Spring Boot.
Java Multi-line String
Filed under Java String
While waiting for JDK 13, what are other ways that Java supports multi-line strings?
Checking If a String Is a Repeated Substring
Filed under Java String
Learn two ways of checking if a String consists only of its substrings in Java.
Checking for Empty or Blank Strings in Java
Filed under Java String
Check out some simple ways in Java to test if a string is blank or empty.
Java Weekly, Issue 288
Filed under Weekly Review
A quick implementation of an API gateway and service discovery using Spring Cloud Gateway and Spring Cloud Netflix Eureka Server.
Breaking Out of Nested Loops
Filed under Java
Explore different ways to break from a loop in Java.
Understanding getBean() in Spring
Filed under Spring
Learn about the different variants of Spring’s BeanFactory.getBean() method for retrieving a bean instance from the Spring container
Handling Maven Invalid LOC Header Error
Filed under Maven
Learn how to handle an invalid LOC header error in Maven.
Templating with Handlebars
Filed under Java String
Learn how to build and interact with templates using Handlebars.
Converting Iterator to List
Filed under Java Collections
Explore the various methods for converting an Iterator to a List in Java.
How to Break from Java Stream forEach
Filed under Java Streams
Java Streams are often a good replacement for loops. Where loops provide the break keyword, we have do something a little different to stop a Stream.
Java Weekly, Issue 287
Filed under Weekly Review
A couple of write-ups on the JEP-355 Text Blocks preview proposal for Multiline String Literals in Java 13, and an introduction to JPA/Hibernate query hints.
Google AutoService
Filed under Java
Learn how to use Google’s AutoService to generate Java Service Provider Interface (SPI) configuration files
Overview of JPA/Hibernate Cascade Types
Filed under JPA
A quick and practical overview of JPA/Hibernate Cascade Types.
Understanding the JAR Manifest File
Filed under Java
Learn about the JAR Manifest file, its capabilities and more.
Lazy Initialization in Spring Boot 2
Filed under Spring Boot
Learn how to configure lazy initialization in Spring Boot.
Java Weekly, Issue 286
Filed under Weekly Review
A new series on Spring Cloud Gateway kicks off, and a good write-up on the opposite nature of objects and data structures.
Download a Large File Through a Spring RestTemplate
Filed under HTTP Client-Side, Spring
Explore different techniques on how to download large files with RestTemplate.
Converting JSON to CSV in Java
A quick and practical overview of converting JSON to CSV in Java.
Converting Iterable to Collection in Java
Filed under Java Collections
Learn how to convert an Iterable to a Collection with a core Java solution or other libraries
Java Weekly, Issue 285
Filed under Weekly Review
A cool library for testing database migrations in JUnit that uses throwaway Docker containers, and a method for making S3 signed URLs cacheable.
Copying Sets in Java
Filed under Java Collections
Learn several different ways how to copy a Set in Java.
The Spring Boot Starter Parent
Filed under Spring Boot
Learn how to use the Spring Boot Starter Parent.
Java Optional as Return Type
Filed under Java
Learn the best practices and when to return the Optional type in Java.
Spring Session with MongoDB
Learn how to manage Spring Sessions with MongoDB.
Decode an OkHttp JSON Response
Filed under HTTP Client-Side, JSON
Learn several techniques for decoding a JSON OkHttp response
Java Weekly, Issue 284
Filed under Weekly Review
A new Spring Cloud Services project for building service brokers, and a look at Hypersistence Optimizer, a performance tuner for JPA and Hibernate applications.
Using SpringJUnit4ClassRunner with Parameterized
Learn how to use the Parameterized JUnit test runner with a Spring integration test
Guide to ApplicationContextRunner in Spring Boot
Filed under Spring Boot, Testing
Learn how to make the best out of ApplicationContextRunner in Spring Boot.
Will an Error Be Caught by Catch Block in Java?
Filed under Java
A quick and practical introduction to Java Errors.
Geospatial Support in MongoDB
Filed under NoSQL
Have a look at how to store, index and search geospatial data with MongoDB
Refactoring in Eclipse
Filed under IDE
Learn how to apply several refactoring operations in the Eclipse Java IDE.
Enabling Transaction Locks in Spring Data JPA
Filed under Spring Data
Learn how to enable Transaction Locks in Spring Data JPA.
Java Weekly, Issue 283
Filed under Weekly Review
A good primer on implementing feature toggles and managing them in a microservices architecture, and a review of messaging between Message-Driven Beans.
Explore Jersey Request Parameters
Filed under Jakarta EE, REST
Explore how to read different request parameter types via a simple Jersey project.
Understanding the NumberFormatException in Java
Filed under Java Numbers
Learn the various causes of NumberFormatException in Java and some best practices for avoiding it.
Java Weekly, Issue 282
Filed under Weekly Review
A sneak peek at the transactional support coming to Spring Reactive, and a solid piece on dealing with technical debt.
RSocket Using Spring Boot
Filed under Reactive, Spring Boot
Learn how to use RSocket using Spring Boot.
Spring Boot Embedded Tomcat Logs
Filed under Logging, Spring Boot
Tomcat’s logs are disabled by default in Spring Boot. Here’s how to enable and configure them.
Guide to Java FileChannel
Filed under Java IO
Find out how to use the Java NIO FileChannel APIs to read and write files more efficiently.
The Difference Between CDI and EJB Singleton
Filed under Jakarta EE
Explore the differences between JEE CDI and EJB singletons.
Removing Stopwords from a String in Java
Filed under Java String
Have a looks at ways to remove certain words from a Java String
String Initialization in Java
Filed under Java String
Learn about the difference between declaration and initialization of String in Java.
Java Weekly, Issue 281
Filed under Weekly Review
A couple of great articles centered around Test-Driven Development, and an overview of distributed data mesh as an enterprise data architecture.
Converting Between Stream and Array in Java
Filed under Java Array, Java Streams
Learn how to convert a Stream to an array and vice versa in Java.
Derived Query Methods in Spring Data JPA Repositories
Filed under Spring Data
Explore the query derivation mechanism in Spring Data JPA.
Java Weekly, Issue 280
Filed under Weekly Review
An interesting week in the Java ecosystem, as the Eclipse Foundation wrestles control of the javax.* package namespace completely away from Oracle.
Default Column Values in JPA
Filed under JPA
Learn how to set a default column values in JPA.
Get the Path of the /src/test/resources Directory in JUnit
Filed under Testing
Look into different ways to find the path of the /src/test/resources directory
Tagging and Filtering JUnit Tests
Filed under Testing
Learn about a few filtering techniques for JUnit 5 test cases
Guide to Classgraph Library
Filed under Java
Have a look at the Classgraph library, that provides APIs for analyzing the Java classpath
RestTemplate Post Request with JSON
Filed under HTTP Client-Side, REST, Spring
Learn how to use Spring’s RestTemplate to send requests with JSON content.
Run a Java Application from the Command Line
Learn how to create and run a JAR application with or without command-line arguments
Batch Insert/Update with Hibernate/JPA
Filed under JPA
Learn how to use batch inserts and updates using Hibernate/JPA
Convert Time to Milliseconds in Java
Filed under Java Dates
Learn multiple ways of converting Java time objects into Unix-epoch milliseconds
Guide to Maven Profiles
Filed under Maven
Learn how to work with Maven profiles to be able to create different build configurations.
Extending an Array’s Length
Filed under Java Array
Learn about the different ways in which a Java array can be extended.
Spring Data JPA and Named Entity Graphs
Filed under Spring Data
Learn how to better control the entities you want to fetch using Spring JPA.
Java Weekly, Issue 279
Filed under Weekly Review
An overview of the Java wrapper around Hoverfly for testing end-to-end communications in microservices architectures using JUnit 5 and server virtualization.
Check If a String Contains a Substring
Filed under Java String
Explore various ways to search for a substring in a String with performance benchmarks
Difference Between @Size, @Length, and @Column(length=value)
Filed under JPA
@Size, @Length, and @Column(length) each have their different uses on a Java POJO. Learn what they are.
Maps in Groovy
Filed under Groovy
Explore the core operations of Maps in Groovy
Set Operations in Java
Filed under Algorithms, Java Collections
Learn the differences between union, intersection, and relative complement, and how to represent each in Java.
Guide to Google Tink
Filed under Security
Have a look at the cryptographic APIs in the Tink library, built by Google engineers
Spring Data JPA Delete and Relationships
Filed under Spring Data
Explore different ways to delete entities in Spring Data JPA.
Java Weekly, Issue 278
Filed under Weekly Review
Red Hat takes the reins from Oracle in assuming control of OpenJDK 8 and 11, bolstering its support for the Java community, especially enterprise developers.
Generic Constructors in Java
Filed under Java
Learn how to use generic constructors in both generic and non-generic Java classes.
Spring Data JPA Repository Populators
Filed under Spring Data
Learn how to use Spring JPA repository populators to load data from JSON or XML files for testing
Persisting Maps with Hibernate
Filed under Persistence
Using a Map for a Hibernate relationship is a bit different than a List. Learn how it’s done.
How to Configure Spring Boot Tomcat
Filed under DevOps, Spring Boot
Learn how to reconfigure the embedded Tomcat server in Spring Boot for some common use cases.
Spring Boot With H2 Database
Filed under Persistence, Spring Boot
Learn how to configure and how to use the H2 database with Spring Boot.
Setting the Log Level in Spring Boot When Testing
Filed under Spring Boot, Testing
For when you need to diagnose test failures by examining more detailed log output, here is how to reconfigure the logging in Spring apps at test time.
Guide to Guava Multiset
Filed under Java Collections
Store counts of duplicates in a set using Guava Multiset. See how to use this powerful part of the Guava library in single and multi-threaded applications.
Jpa @Embedded and @Embeddable
Filed under JPA
Learn about @Embeddable and @Embedded annotations provided by the Java Persistence API (JPA).
Java Weekly, Issue 277
Filed under Weekly Review
A guide to using coroutines and Kotlin Flow to write non-blocking code in an imperative way with the Spring reactive stack.
JPA Join Types
Filed under JPA
Explore different join types supported by JPA.
Guide to Spock Extensions
Spock’s extension mechanism allows you to hook into a spec’s lifecycle to modify its behavior
A Quick Guide To Using Cloud Foundry UAA
Learn how to use the Cloud Foundry User Account and Authentication (CF UAA) as an identity management service.
Guide to Spring Cloud Kubernetes
Filed under DevOps, Spring Cloud
Learn how to install Minikube, setup, and deploy Spring Boot applications to a local Kubernetes environment.
Java Weekly, Issue 276
Filed under Weekly Review
Java 12 has been out of just a few weeks and packing some really cool functionality. We’re looking at the enhanced switch this week – highly useful.
Spring Cloud Data Flow With Apache Spark
Filed under Spring Cloud
A quick and practical introduction to Spring Cloud Data Flow with Apache Spark.
Reversing a Binary Tree in Java
Filed under Java
A quick and practical guide to reversing a binary tree in Java.
Avoid Check for Null Statement in Java
Filed under Java
Learn several strategies for avoiding the all-too-familiar boilerplate conditional statements to check for null values in Java.
Cannot Reference “X” Before Supertype Constructor Has Been Called
Filed under Java
Find out why the compiler will not let you call an instance method too early in a constructor and what you can do to fix it.
EnvironmentPostProcessor in Spring Boot
Filed under Spring Boot
Learn how to use the EnvironmentPostProcessor to customize the application’s Environment before application context is refreshed.
A Guide to jBPM with Java
Filed under Java
Learn about the Business Process Management (BPM) System and its implementation in Java as jBPM System.
Types of JPA Queries
Filed under JPA
Explore JPA queries along with their usage.
The Exists Query in Spring Data
Filed under Spring Persistence
Learn how to check if an object exists in a database using Spring Data and JPA.
REST-assured Support for Spring MockMvc
Filed under REST, Spring MVC, Testing
Learn how to test Spring REST controllers using the RestAssuredMockMvc API from REST-assured.
Java Weekly, Issue 275
Filed under Weekly Review
A nice write-up comparing assertion libraries for Kotlin, and a first look at a couple of experimental debugging tools for Project Reactor.
Difference Between save() and saveAndFlush() in Spring Data JPA
Filed under Spring Data
Learn about the difference between the save() and saveAndFlush() methods in Spring Data JPA
Differences Between JAR and WAR Packaging
Filed under Java
Learn about the differences between JAR and WAR packaging in Java
Map of Primitives in Java
Filed under Java Map
Learn how to create a Map of Java primitives using popular third-party libraries
Java Weekly, Issue 274
Filed under Weekly Review
A great write-up on controlling test execution order in JUnit 5, and some really solid advice from a veteran conference speaker.
Spring Data JPA – Derived Delete Methods
Filed under Spring Data
Learn how to define Spring Data deleteBy and removeBy methods
Read an InputStream using the Java Server Socket
Filed under Java IO
Learn how to read data from a Java Server Socket.
Guide to jlink
Learn how to create a custom, modular JRE that only contains the bare minimum files using jlink.
TransactionRequiredException Error
Filed under JPA
Learn about the cause of the TransactionRequiredException error and how to solve it.
Spring Boot Reactor Netty Configuration
Filed under Reactive, Spring Boot
Learn about different configuration options for a Reactor Netty server in a Spring Boot application
Spring Boot Consuming and Producing JSON
Filed under JSON, Spring Boot
Learn how to consume and produce JSON content in a typical CRUD REST service developed with a Spring Boot.
Java Weekly, Issue 273
Filed under Weekly Review
A good week in the Java and Spring ecosystems, as Java 12 is released, and a nice write-up on Spring’s @ConfigurationProperties annotation.
Getting and Verifying Response Data with REST-assured
Filed under HTTP Client-Side, REST, Spring, Testing
Have a look at how to use REST-assured to validate and extract the response from a REST endpoint
Spring Boot with Hibernate
Filed under Spring Boot, Spring Persistence
A quick, practical intro to integrating Spring Boot and Hibernate/JPA.
A Java Web Application Without a web.xml
Filed under Jakarta EE
Learn how to use the Java Servlet 3.0 annotations instead of a web.xml file
RxJava Hooks
Filed under Reactive
Learn about the various RxJava lifecycle hooks and how can we implement them
Method Inlining in the JVM
Filed under JVM
Learn about the method inlining in the JVM and how the Just-In-Time compiler achieves it.
Using @Autowired in Abstract Classes
Filed under Spring
Learn the differences of using @Autowired on abstract classes vs. concrete classes
Making a JSON POST Request With HttpURLConnection
Filed under HTTP Client-Side
A quick and practical introduction to issuing POST requests using HttpURLConnection.
How to Return 404 with Spring WebFlux
Filed under Reactive, Spring Web
Learn how to return 404 status code in Spring WebFlux
Java Weekly, Issue 272
Filed under Weekly Review
A great write-up on conditional Spring bean annotations, and an overview of JVM memory and the challenge of tuning it for optimal performance.
Spring Properties File Outside jar
Filed under Spring
Learn how to load Spring properties from outside the jar package
Mapping Multiple JSON Fields to a Single Java Field
Filed under JSON
Learn how to convert multiple formats JSON into the same Java object.
Resolving “Failed to Configure a DataSource” Error
Filed under Spring Boot, Spring Data
Learn what causes the Spring Boot error “Failed to configure a DataSource” and how to resolve it
Eclipse Error: web.xml is missing and failOnMissingWebXml is set to true
Filed under IDE, Jakarta EE
Learn how to fix the eclipse error: web.xml is missing and failOnMissingWebXml is set to true
Difference Between Stub, Mock, and Spy in the Spock Framework
Understand the difference between Stubs, Mocks and Spies in Spock and how they can help to test an application
Using the @Singular Annotation with Lombok Builders
Filed under Java
Learn how to use the @Singular annotation to create convenient builders with Lombok
Guide to the JDBC ResultSet Interface
Filed under Persistence
Learn how to use the JDBC ResultSet API for retrieving and updating data
Introduction to Spring Cloud OpenFeign
Filed under Spring Cloud
Feign makes writing web service clients easier with pluggable annotation support, which includes Feign annotations and JAX-RS annotations.
Adding a Copyright License Header for Java Source Files in IntelliJ IDEA
Filed under IDE
Learn how to configure IntelliJ IDEA to add license headers automatically to your project files.
Filtering a Java Collection by a List
Filed under Java Collections
Learn different ways to filter a Collection in Java based on the values of another list
Combining JPA And/Or Criteria Predicates
Filed under JPA
Learn how to use the JPA Criteria API to implement use cases where we needed to combine AND/OR predicates.
Lists in Groovy
Filed under Groovy
An overview of working with Lists in Groovy
Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])
Filed under Java Array
Compare the performance of Arrays.sort() for Objects and primitives
Java Weekly, Issue 271
Filed under Weekly Review
An early look at the JEP 343 Packaging Tool that’s due in JDK 13, and a new series on Reactor’s advanced concepts takes a deep dive into its inner workings.
Spring Data JPA Batch Inserts
Filed under Spring Persistence
Learn what needs to happen for JPA Hibernate to batch inserts, and what Spring can do to help.
JDK Configuration for Maven Build in Eclipse
Learn how to configure Maven builds to work within the Eclipse IDE.
Static Content in Spring WebFlux
Filed under Spring Web
Explore how to serve static content in our web applications using Spring WebFlux.
Convert String to JsonObject with Gson
Filed under JSON
Learn a couple of methods for converting a JSON String into a JsonObject using the Gson library in Java.
JUnit 5 Conditional Test Execution with Annotations
Filed under Testing
Learn how to use JUnit 5 annotations to specify the conditions under which your tests should run.
A Guide to the Reflections Library
Filed under Java
Learn how to configure the Reflections library and use it in your Java projects
Java Weekly, Issue 270
Filed under Weekly Review
An overview of new Spring Boot Initializr features, including an enhanced API for custom project generation, plus a handful of Spring Security OAuth releases.
How to Change Java Version in an Eclipse Project
Filed under IDE
Learn how to add a new JRE into our Eclipse workspace and how to switch to a different Java version in our current Eclipse project.
Maven Enforcer Plugin
Filed under Maven
Learn about the Maven Enforcer Plugin and how we can use it to guarantee the level of compliance in our project.
Ratpack with RxJava
Filed under Reactive
Learn how to add RxJava to a Ratpack server to create a nice reactive application
Testing Web APIs with Postman Collections
Filed under Testing
Learn how to create a Postman Collection that can test a REST API
Iterating Over an Instance of org.json.JSONObject
Filed under JSON
Learn how to iterate and traverse through a JSONObject
Java Weekly, Issue 269
Filed under Weekly Review
New Spring Boot and Security releases are out this week, and a well-organized round-up of everything that has changed in Java and the JVM since JDK 8.
Validating RequestParams and PathVariables in Spring
Filed under Spring MVC
Learn how to validate request parameters and path variables with Spring MVC
Guide to Apache Commons MultiValuedMap
Filed under Java Map
Learn how to use MultiValuedMap from the Apache Commons Collections library to map each key to a collection of values in Java.
Using WireMock Scenarios
Filed under Testing
Have a look at testing stateful APIs using WireMock Scenarios
Performance Comparison of Primitive Lists in Java
Filed under Java Collections
Compare the performance of some popular primitive list libraries in Java
Formatting JSON Dates in Spring Boot
Filed under JSON, Spring Boot
Explore a number of different ways to format JSON dates in a Spring Boot application.
Types of Strings in Groovy
Filed under Groovy
Learn the many capabilities of Groovy’s single-, double-, and tripled-quoted strings and its native support for regex, interpolation, and multi-line.
Multi-Release Jar Files
Filed under Java
Learn about Java 9’s Multi-Release JAR files using a simple example
Creating a Custom Annotation in Java
Filed under Core Java
Learn how to create and process a custom annotation in Java
Hibernate Query Plan Cache
Filed under Persistence
Have a look at how Hibernate’s Query Plan Cache can help improve the performance of an application.
Java Weekly, Issue 268
Filed under Weekly Review
An in-depth look at Spring Boot configuration with application.properties, and several strategies for dealing with FaaS cold starts.
Working With Maps Using Streams
Filed under Java Map, Java Streams
Learn how to combine Java Maps and Streams
Determine If All Elements Are the Same in a Java List
Filed under Java Collections
Learn different ways to determine if all elements in a list are equal
Fixing 401s with CORS Preflights and Spring Security
Filed under Spring Security
Learn how to fix HTTP error status 401 for CORS preflight requests
Creating a SOAP Web Service with Spring
Filed under Spring Boot
Learn how to create a SOAP-based web service using Spring Boot
How to Test the @Scheduled Annotation
Learn how to test the @Scheduled annotation in Spring with a simple integration test and the Awaitility library.
A Guide to the Problem Spring Web Library
Filed under Spring
Learn how to use the Problem Spring Web library to create messages with the errors’ details using an application/problem+json response.
Handle Security in Zuul, with OAuth2 and JWT
Filed under Spring Security
Learn about how you can use the Zuul edge service in conjunction with OAuth and JWTs to secure your web services
Defining a Char Stack in Java
Filed under Java Collections
Learn how to create a char stack in Java.
Filtering Jackson JSON Output Based on Spring Security Role
Filed under Jackson, Spring Security
Learn how to filter JSON output in a web application based on a Spring Security role.
Guide to Creating and Running a Jar File in Java
Learn different ways to package and run a simple Java application as a jar
Marker Interfaces in Java
Filed under Core Java
Learn about Java marker interfaces and how they compare to typical interfaces and annotations
Differences Between Oracle JDK and OpenJDK
Filed under JVM
Explore the differences between Oracle Java Development Kit and OpenJDK.
Guice vs Spring – Dependency Injection
Filed under Spring
Learn about the similarities and differences between Guice and Spring for dependency injection
Announcing “Learn Spring”
Filed under Spring Boot, Spring MVC
Announcing a new course – Learn Spring – to get you started on your Spring journey.
Java Weekly, Issue 267
Filed under Weekly Review
A look under-the-hood at the JDK 9+ bytecode generated by the String concatenation operator, which is completely decoupled from the StringBuilder class.
Method References in Java
Filed under Core Java
A quick and practical overview of method references in Java.
Java Classes and Objects
Filed under Core Java
Explore two basic concepts of the Java language – classes and objects – with examples of their implementation.
List of Primitive Integer Values in Java
Filed under Java Collections
Learn how to create a List of primitive integers using core Java and external libraries
Java Bitwise Operators
Filed under Core Java
Learn about the bitwise operators in Java and how each of them work
List Files in a Directory in Java
Filed under Java IO
Learn some different ways to list the files in a directory and subdirectories in Java.
Java Weekly, Issue 266
Filed under Weekly Review
A lightweight approach to CDI bean testing with Weld, plus a look at four quality gates you can use to evaluate whether your release is production-ready.
Spring Dependency Injection
Learn about Dependency Injection using the Spring framework.
Spring Data JPA Query by Example
Filed under Spring Data
Learn how to use Spring Data’s Query by Example API
Check If a String Contains Multiple Keywords in Java
Filed under Java String
Learn about various methods to determine if a Java String contains multiple keywords
OpenJDK Project Loom
Filed under Core Java, Java Concurrency
Learn about Project Loom’s attempt to introduce a lightweight concurrency construct to Java
Guide to XMPP Smack Client
Filed under Java
A quick guide to creating an XMPP client using Smack
Delete the Contents of a File in Java
Filed under Java IO
Learn various ways to remove the contents of a file without deleting the file.
Finding Leap Years in Java
Filed under Java Dates
A quick and practical guide to finding leap years in Java.
Java Weekly, Issue 265
Filed under Weekly Review
A good introduction to writing and managing custom addons in TestProject, plus a collection of handy OpenJDK commands every developer should know.
Variable Scope in Java
Filed under Core Java
Learn about the scopes in which Java variables are valid
Counting Matches on a Stream Filter
Filed under Java Streams
Learn how to filter a Stream and count the matches
Implementing Simple State Machines with Java Enums
Filed under Algorithms
Learn how to use Java Enums to build simple state machines
JPA 2.2 Support for Java 8 Date/Time Types
Filed under JPA
Have a look at how to use the java.time package classes with JPA
Summing Numbers with Java Streams
Filed under Java Streams
A quick and practical guide to summing numbers with Java Stream API.
Spring Boot Ehcache Example
Filed under Spring Boot
A quick and practical guide to using Spring with Ehcache.
How to Write to a CSV File in Java
Filed under Java IO
A quick and practical guide to writing to CSV in Java.
Setting up Lombok with Eclipse and Intellij
Filed under IDE
Learn how to set up Lombok with popular IDEs
Spring PostConstruct and PreDestroy Annotations
Filed under Spring
Learn about Spring’s lifecycle annotations PostConstruct and PreDestroy.
Deprecated Classes in Spring
Filed under Spring Boot, Spring Security, Spring Web
Explore deprecated classes in Spring and Spring Boot.
Map to String Conversion in Java
Filed under Java Map
Learn how to convert a Map to a String and the other way around using both core Java methods and third-party libraries.
Converting Between LocalDate and SQL Date
Filed under Java Dates
Learn how to convert between java.sql.Date and java.time.LocalDate
Java Weekly, Issue 264
Filed under Weekly Review
A busy week in the Java and Spring ecosystem, with several major releases, including Spring Framework, Spring Boot, and Spring Security, among others.
How to Find JAVA_HOME
Learn that there is more than one way to find JAVA_HOME, including a platform-independent one.
Deserialize Immutable Objects with Jackson
Filed under Jackson
Learn how to use Jackson to deserialize immutable objects
Enabling TLS v1.2 in Java 7
Filed under Security
Learn how to upgrade the SSL socket protocol to TLS 1.2 in Java 7.
Using Curl in Java
Filed under Networking
Learn how to use the curl tool inside a Java program.
Java instanceof Operator
Filed under Core Java
Learn about the instanceof operator in Java
Intro to Derive4J
Filed under Java
A quick and practical overview of Derive4j.
Attaching Values to Java Enum
Filed under Core Java
Explore features of the Java Enum implementation.
Java toString() Method
Filed under Java String
Learn about Java’s toString method.
Java Weekly, Issue 263
Filed under Weekly Review
A new series from Spring on integrating Boot apps with Microsoft Azure, and a quick guide on how to run tests individually and in groups with TestProject.
Check if a String Is a Pangram in Java
Filed under Java String
Learn how to determine if a Java String contains all of the letters in the alphabet
Java ArrayList vs Vector
Filed under Java Collections
Learn about the differences between the Java ArrayList and Vector classes
Java Two Pointer Technique
Filed under Algorithms
Learn about Java’s Two Pointer Technique with practical examples.
Java String Interview Questions and Answers
Filed under Java String
Prepare for your next Java interview. How many of these do you already know?
Exclude Auto-Configuration Classes in Spring Boot Tests
Filed under Spring Boot, Testing
Learn how to disable specific auto-configuration in Spring Boot tests
Control Structures in Java
Filed under Core Java
Learn about the control structures you can use in Java.
Multi Dimensional ArrayList in Java
Filed under Java Collections
Learn how to create and work with multidimensional ArrayLists in Java.
Immutable Set in Java
Filed under Java Collections
Learn about different ways to create an immutable set in Java
Java Weekly, Issue 262
Filed under Weekly Review
An opinion piece predicting what’s in store for the Java ecosystem in 2019, and a good review of expression-based access control.
If-Else Statement in Java
Filed under Core Java
Learn how to use the if-else statement in Java.
The Java Native Keyword and Methods
Filed under Java
Learn the basics of the Java native keywords and methods.
Introduction to Basic Syntax in Java
Filed under Core Java
Explore the basics of Java syntax.
INSERT Statement in JPA
Filed under JPA
Learn about three ways to perform an INSERT statement with JPA.
Criteria Queries Using JPA Metamodel
Filed under Persistence
Discover how to use JPA’s Metamodel to create criteria queries.
Convert a Comma Separated String to a List in Java
Filed under Java String
Discover how to convert a comma separated string of integers or strings to a list in Java.
Passing Parameters to Java Threads
Filed under Java Concurrency
Learn a couple of ways to send a parameter to a thread in Java
Hibernate 5 Bootstrapping API
Filed under Persistence
Learn how to use the new native bootstrapping process introduced in Hibernate 5
Differences Between HashMap and Hashtable in Java
Filed under Java Map
Learn about the differences between Java’s HashMap and Hashtable collections
Replace a Character at a Specific Index in a String in Java
Filed under Java String
Learn several methods for replacing a character at a specific index in a Java String.
Intersection of Two Lists in Java
Filed under Java Collections
Learn how to retrieve the intersection of two Lists.
Java Weekly, Issue 261
Filed under Weekly Review
An overview of the Java 12 preview features that will make it into the release, and one long-awaited feature, String literals, that did not make the cut.
Introduction to JVM Code Cache
Filed under JVM
Learn about the JVM’s code cache memory usage and tuning settings
Persist a JSON Object Using Hibernate
Filed under JSON, Persistence
Learn how attribute converters make it easy to persist JSON objects in Hibernate.
Testing Reactive Streams Using StepVerifier and TestPublisher
Learn how to use StepVerifier and TestPublisher to test reactive streams in a sample Spring Reactor project.
BufferedReader vs Console vs Scanner in Java
Filed under Java IO
A quick and practical comparison of BufferedReader, Console, and Scanner in Java.
Java EE 7 Batch Processing
Filed under Jakarta EE
A quick and practical introduction to batch processing in Java EE7.
Java Weekly, Issue 260
Filed under Weekly Review
A solid post on Spring performance optimizations, and a couple of good write-ups on Hibernate and JPA.
Working with Primitive Values in Gson
Filed under JSON
Learn how Google’s Gson library serializes and deserializes Java primitive types
Sorting Arrays in Java
Filed under Java Array
Learn how to sort arrays or primitive types and objects in ascending and descending order
Java 8 Predicate Chain
Filed under Core Java
Learn different ways to chain Predicates in Java
Implementing a Custom Lombok Annotation
Filed under Java
Learn how to implement a custom annotation using Lombok handlers.
IntelliJ Debugging Tricks
Filed under IDE
Learn some helpful tricks to use when developing in IntelliJ to increase your productivity
Guide to Java Packages
Filed under Core Java
Learn about packages in Java
Calculate Factorial in Java
Filed under Algorithms
Learn several ways to calculate factorials in Java.
Find Substrings That Are Palindromes in Java
Filed under Algorithms
Learn several algorithms for finding all palindromes within a given string in Java.
Guide to ShedLock with Spring
Filed under Spring
Learn how to use ShedLock for scheduled jobs in your Spring application
Introduction to RSocket
Filed under Reactive
An introduction to RSocket and the 4 interaction models it provides.
Programmatically Restarting a Spring Boot Application
Filed under Spring Boot
Learn a few ways to restart a Spring Boot application with Java
Introduction to Functional Java
Filed under Java
Discover the basics of the Functional Java library
Using c3p0 with Hibernate
Filed under Persistence
Learn how to add c3p0 to a Hibernate application and configure some common properties
Guide to the Hibernate EntityManager
Filed under Persistence
Have a look at the EntityManager class and its use in Hibernate
Java Stream Filter with Lambda Expression
Filed under Java Streams
Learn how to use lambda expressions with Stream.filter() and handle checked exceptions
Spring MVC Interview Questions
Filed under Spring MVC
Explore Spring MVC interview questions.
Comparing Two HashMaps in Java
Filed under Java Map
Learn how to compare two HashMaps in Java as well as find the differences between them
Escape JSON String in Java
Filed under JSON
Learn ways to escape a JSON String core Java or a library
Java Weekly, Issue 259
Filed under Weekly Review
From custom entity listeners in Hibernate, to (finally) some interesting persistence reactive support. A good week.
Converting Synchronous and Asynchronous APIs to Observables using RxJava2
Filed under Reactive
Learn how to translate asynchronous and synchronous programming styles into Observables with RxJava2
How to Start a Thread in Java
Filed under Java Concurrency
Explore different ways to start a thread and execute parallel tasks.
How to Check if Java Is Installed
Learn how to find out if Java is installed on a Windows 10, Mac OS X or Linux/Unix machine even if it’s not on the PATH.
One-to-One Relationship in JPA
Filed under JPA
Learn three different ways to maintain a one-to-one relationship with JPA.
Find the Longest Substring Without Repeating Characters
Filed under Java String
Learn how to find the longest substring without repeating a character in Java.
Java Compound Operators
Filed under Core Java
Learn how compound operators work in Java
Immutable Map Implementations in Java
Filed under Java Map
Explore the differences between an Unmodifiable Map and Immutable Map in Java.
Spring Boot With SQLite
Filed under Spring Boot, Spring Persistence
Configure a Spring Boot application with SQLite persistence
Formatting Output with printf() in Java
Filed under Core Java
Learn how to format output using Java’s PrintStream.printf() method
JPA Entity Graph
Filed under JPA
Load related associations using the JPA Entity Graph feature.
Java Weekly, Issue 258
Filed under Weekly Review
A great week in the Java and Spring ecosystems, with three new Spring Boot releases, and a nice review of Spring Bean scopes and how they impact thread safety.
Customizing Authorization and Token Requests with Spring Security 5.1 Client
Filed under Spring Security
Customize OAuth2 client requests in Spring Security 5
Get All Data from a Table with Hibernate
Filed under Persistence
Explore retrieving data from a table using JPQL and Criteria queries.
Auto-Generated Field for MongoDB using Spring Boot
Filed under NoSQL, Spring Boot, Spring Persistence
Learn how to generate sequential, auto-incremented values for the id field and simulate the same behavior as seen in SQL databases.
Ways to Iterate Over a List in Java
Filed under Java Collections
Review different ways to iterate through a List in Java
Java Weekly, Issue 257
Filed under Weekly Review
A comprehensive look at the raw, multi-line String literals feature coming soon to Java 12, and Spring Framework delivers three new releases.
Spring Data with Reactive Cassandra
Filed under NoSQL, Reactive, Spring Data
Learn about connecting to Cassandra using the Spring Data Reactive stack.
Array to String Conversions
Filed under Java String
Learn how to convert arrays to strings and back again in Java
Join Array of Primitives with Separator in Java
Filed under Java Array
Learn how to join an array of primitives with a separator character or string in Java.
Logging a Reactive Sequence
Filed under Reactive, Spring Web
Learn how to log reactive streams.
Java equals() and hashCode() Contracts
Filed under Core Java
Learn about the contracts that equals() and hasCode() need to fulfill and the relationship between the two methods
Java CyclicBarrier vs CountDownLatch
Filed under Java Concurrency
Compare and contrast the Java CyclicBarrier and CountDownLatch synchronization utilities
Abstract Factory Pattern in Java
Filed under Java
Understand the abstract factory design pattern along with its Java implementation.
Sorting Query Results with Spring Data
Filed under Spring Data
Learn different ways to sort results in Spring Data queries.
Introduction to RESTX
Filed under REST
Learn how to use the RESTX framework to build REST APIs
Java Weekly, Issue 256
Filed under Weekly Review
A deep dive into switch expressions in Java 12, and Amazon’s preview release of Corretto: a free, multi-platform, production-ready OpenJDK build. Very exciting.
The Decorator Pattern in Java
Filed under Java
A guide to the decorator design pattern and its Java implementation
A Guide to Constructors in Java
Filed under Core Java
Learn the basics about constructors in Java as well as some advanced tips
Basic IntelliJ Configuration
Filed under IDE
Learn about basic configuration and usage of the IntelliJ IDE
Remove or Replace Part of a String in Java
Filed under Java String
Explore more than one way of removing and replacing a substring in Java.
A Guide to the Java Math Class
Filed under Java Numbers
Learn about the Math class that provides helpful static methods for performing numeric operations.
Convert Between String and Timestamp
Filed under Java Dates, Java String
Learn how to convert between String and Timestamp with a little help from LocalDateTime and Java 8.
Java Compiler Error: “class, interface, or enum expected”
Filed under Java
Learn about the “class, interface, or enum expected” Java compiler error and how to fix it
Guide to ReflectionTestUtils for Unit Testing
Learn how to use ReflectionTestUtils in unit testing by going through several examples.
Criteria API – An Example of IN Expressions
Filed under JPA
Learn different ways to achieve the IN operation using the Criteria API.
Adding a Newline Character to a String in Java
Filed under Java String
Learn about newline characters in Java for text output and HTML
Pad a String with Zeros or Spaces in Java
Filed under Java String
Learn how to pad a String in Java with a specific character.
Customizing HTTP Endpoints in Spring Data REST
Filed under REST, Spring Data
Learn how to restrict which repository methods are exposed as endpoints in a Spring Data REST application, as well as how to customize their URL mappings.
Spring @RequestParam Annotation
Filed under Spring MVC
A detailed guide to Spring’s @RequestParam annotation
Java Weekly, Issue 255
Filed under Weekly Review
A quick guide to building optimized Dockerfiles for Spring Boot applications, and a Big Data cloud provisioning automation project is met with steep challenges.
Calculate the Area of a Circle in Java
Filed under Algorithms, Java
Explore different ways of calculating the area of a circle using Java.
Mockito Tutorial
Learn how to work with the popular Java mocking library Mockito, for clean and readable unit tests.
ZonedDateTime with Spring Data MongoDB
Filed under NoSQL, Spring Data
Learn how to create MongoDB converters in order to handle Java ZonedDateTime objects.
Limiting Query Results With JPA and Spring Data JPA
Filed under Spring Data
Learn about limiting query results with JPA and Spring Data JPA.
Java Weekly, Issue 254
Filed under Weekly Review
A quick look at Spring Boot DevTools and how it can speed up development, plus a list of the top 100 Java libraries in 2018.
How to Replace Many if Statements in Java
Filed under Java
Learn various ways of replacing complex nested if statements
Deep Dive Into the New Java JIT Compiler – Graal
Filed under JVM
Explore the functionalities of the new Java JIT compiler – Graal.
Installing Java on Ubuntu
Learn how to install OpenJDK and Oracle JDK versions 8 through 11 on Ubuntu systems.
Generate a Secure Random Password in Java
Learn several methods for generating secure random passwords in Java.
Guide to BufferedReader
Filed under Java IO
Learn the basics as well as some advanced features from the BufferedReader class
Spring Security OAuth Login with WebFlux
Filed under HTTP Client-Side, Spring Web
Configure the OAuth Login support in a Spring Webflux application.
Mocking a RestTemplate in Spring
Filed under HTTP Client-Side, Spring Web, Testing
A simple guide to mocking when using Spring’s RestTemplate.
Print Even and Odd Numbers Using 2 Threads
Filed under Java Concurrency, Java Numbers
Learn how to synchronize Threads to print even and odd numbers alternatingly
Convert Between java.time.Instant and java.sql.Timestamp
Filed under Java Dates
Convert a java.time.Instant to java.sql.Timestamp and vice-versa.
Understanding Memory Leaks in Java
Filed under Core Java
Learn what memory leaks are in Java, how to recognize them at runtime, what causes them, and strategies for preventing them.
Hibernate Field Naming with Spring Boot
Filed under Spring Boot, Spring Persistence
Learn how Spring Boot configures Hibernate’s field naming strategies and how to configure them yourself.
A Guide to EnumMap
Filed under Java Map
Learn why if you aren’t yet using EnumMap, you should be.
Using indexOf to Find All Occurrences of a Word in a String
Filed under Java String
Learn how to solve the “needle in a haystack” problem by using the indexOf method to find all occurrences of a word in a larger text string.
Lombok Builder with Custom Setter
Filed under Java
Have a look at how to use the generated Lombok Builder with a custom setter.
Microservices with Oracle Helidon
Filed under Architecture, Jakarta EE
Learn how to build microservices in Java with Oracle’s Helidon framework and its two programming models: Helidon SE and Helidon MP.
Java Weekly, Issue 253
Filed under Weekly Review
A good write-up on HTTP response caching in Spring, a handful of new Spring releases including Spring Boot 2.1, and IBM announces plans to acquire RedHat.
Reading a CSV File into an Array
Filed under Java IO
A.simple tutorial to reading CSV files in Java arrays.
Java Weekly, Issue 252
Filed under Weekly Review
In this edition, we get a quick look at Java 11’s support for asynchronous HTTP/2 requests and responses using reactive streams, and Stack Overflow turns ten!
Intro to Apache Storm
Filed under Architecture
Learn how to use Apache Storm to process streams of data
Working with Date Parameters in Spring
Filed under Java Dates, Spring MVC
Learn how to work with Date parameters in Spring MVC
Lombok Builder With Default Value
Filed under Java
Learn how to create a builder default property values using Lombok
HTTPS using Self-Signed Certificate in Spring Boot
Filed under Security, Spring Boot
Explore how to generate a self-signed certificate to enable HTTPS in a Spring Boot application.
Request Method Not Supported (405) in Spring
Filed under REST, Spring MVC
A quick article focused on a common error – ‘Request Method not Supported – 405’
Format ZonedDateTime to String
Filed under Java Dates
Learn how to convert ZonedDateTime to String and vice-versa in Java
Introduction to Apache Pulsar
Filed under Architecture, Java
Learn about the Apache Pulsar publish-subscribe messaging system
Converting a Collection to ArrayList in Java
Filed under Java Collections
A brief tutorial to building ArrayLists given a collection in Java.
An Introduction to SuanShu
Filed under Java
Learn about the SuanShu – a Java math library for numerical analysis, statistics, root finding, linear algebra, optimization, and lots more.
Custom Types in Hibernate and the @Type Annotation
Filed under Persistence
Learn how to use custom Java classes to extend basic type mapping in Hibernate
A Guide to Spring Session Reactive Support: WebSession
Filed under Spring Web
A quick and practical introduction to Spring Session reactive support.
Convert JSON to a Map Using Gson
Filed under JSON
Learn how to use Google’s Gson library to convert a JSON string to a HashMap in Java.
Dockerizing Java Apps using Jib
Filed under DevOps
Learn to simplify containerization of Java applications using Jib
Java Weekly, Issue 251
Filed under Weekly Review
A nice write-up on server-side Kotlin, along with deep dives into Garbage Collection and window functions for aggregating event streams.
Display Auto-Configuration Report in Spring Boot
Filed under Spring Boot
Learn which beans are automatically configured in your Spring Boot application by generating an auto-configuration report during startup.
Concrete Class in Java
Filed under Core Java
Learn about java concrete classes and how they are different than interfaces and abstract classes
Convert XML to JSON Using Jackson
Filed under Jackson
Learn different ways in which Jackson can read XML data and write it to JSON.
Using JUnit 5 with Gradle
Filed under Testing
Learn how to set up and run JUnit 5 tests with Gradle.
Maven Error “JAVA_HOME should point to a JDK not a JRE”
Filed under Maven
Learn about the root cause of the Maven error ‘JAVA_HOME should point to a JDK not a JRE’ and how to resolve it
An Introduction to Spring Data Redis Reactive
Filed under NoSQL, Spring Data
Learn the basics of using Spring Data Redis Reactive
Guide to Ebean ORM
Filed under Persistence
Learn how to interact with a database using Ebean
Java 8 Streams: Find Items From One List Based on Values From Another List
Filed under Java Streams
Learn how to use data from one stream to find items in another
Combining Different Types of Collections in Java
Filed under Java Collections
Explore different ways of combining collections in Java.
Converting Between Byte Arrays and Hexadecimal Strings in Java
Filed under Java Array
Learn how to convert between hexadecimal strings and byte arrays using the JDK and other popular libraries.
Setting the Java Version in Maven
Learn about different ways to set the Java version for your Maven project
Write an org.w3.dom.Document to a File
Filed under XML
Learn how to write and customize XML output in Java
Guide to DateTimeFormatter
Filed under Java Dates
Learn how to use the Java 8 DateTimeFormatter class to format and parse dates and times
Java Weekly, Issue 250
Filed under Weekly Review
A historical look at how the hashing algorithm for Strings has improved steadily with each Java release, and a review of the latest Kotlin features.
How to Use if/else Logic in Java 8 Streams
Filed under Java Streams
Learn how to apply if/else logic to Java 8 Streams.
Insertion Sort in Java
Filed under Core Java
An explanation of the insertion sort algorithm and a look at its Java implementation
Cache Eviction in Spring Boot
Filed under Spring Boot
Learn how to invalidate caches with Spring Boot.
Maven Polyglot
Filed under Maven
Learn how to build the POM file in different languages using Maven Polyglot
WildFly with Eclipse – Installation and Setup
Filed under Jakarta EE
Learn how to run and debug applications on WildFly directly from the Eclipse IDE.
How to Check If a Key Exists in a Map
Filed under Java Map
Learn how to check if a key exists in a Map in Java and a common pitfall.
Using Math.sin with Degrees
Filed under Algorithms
Learn how to work with Java’s trigonometric functions in degree mode.
Spring Data MongoDB Transactions
Filed under NoSQL, Spring Data
Learn about transaction support in Spring Data MongoDB
Merging Two Maps with Java 8
Filed under Java Map
Learn different techniques for merging maps in Java 8
Java Weekly, Issue 249
Filed under Weekly Review
A busy week in the Spring and Java ecosystems, with lots of content from SpringOne Platform 2018, and a great way to organize your BDD-style tests in JUnit 5.
Proxy in Hibernate load() Method
Filed under Persistence
Learn how Hibernate proxies work and how this impacts the load method with entities and their relationships.
Combining RxJava Completables
Filed under Reactive
Learn different ways of how to combine Completables with RxJava
Quicksort Algorithm Implementation in Java
Filed under Algorithms, Java
Explore the details of the QuickSort algorithm, focusing on the Java implementation.
CDI Portable Extension and Flyway
Filed under Jakarta EE, Persistence
Learn how to create a CDI Portable Extension
A Quick Guide to Apache Geode
Filed under Persistence
Learn the basics of Geode’s capabilities as an in-memory data grid, including sophisticated caching and distributed computation.
Calculate Percentage in Java
Filed under Algorithms
A simple tutorial about calculating percentage in Java using a CLI program.
Operating on and Removing an Item from Stream
Filed under Java Streams
Learn about the various ways in which we can operate on an item in a Java 8 Stream and then remove it once the operation is complete.
A Controller, Service and DAO Example with Spring Boot and JSF
Filed under Jakarta EE, Spring
An example application of using a controller, service and DAO with JSF and Spring Boot.
Merge Sort in Java
Filed under Algorithms
Understand the merge sort algorithm and its implementation in Java
Online Java Compilers
Learn about the main features of the top Java online compilers
String Performance Hints
Filed under Java String
Learn about the performance aspects of the Java String API
Exactly Once Processing in Kafka with Java
Filed under Data
A brief tutorial to understanding exactly once processing in Kafka using the transactional API.
Maven Goals and Phases
Filed under Maven
Understand the concepts of Maven lifecycle, phases, goals and plugins.
A Comparison Between Spring and Spring Boot
Filed under Spring Boot
Understand the difference between Spring and Spring Boot.
Java Weekly, Issue 248
Filed under Weekly Review
Java 11 is finally out, and an optimization for read-only JPA queries is now available in Spring. A good week.
Guide to ScribeJava
Filed under HTTP Client-Side, Security
A brief tutorial to consuming OAuth1 and OAuth2 APIs using ScribeJava.
Introduction to Protonpack
Filed under Java Streams
Learn about the Java Stream API utility classes provided by the Protonpack library
Spring Persistence Tutorial
Filed under Series, Spring Persistence
Persistence with Spring 5 Tutorial – setup for Hibernate, JPA, Spring Data JPA, the DAO layer and Transactions.
Sort a HashMap in Java
Filed under Java Map
Learn how to sort HashMap entries by their key or value
Access the Same In-Memory H2 Database in Multiple Spring Boot Applications
Filed under Spring Boot, Spring Persistence
Learn how to start an in-memory H2 database in one Spring Boot application and access the same database in another over TCP.
ZoneOffset in Java
Filed under Java Dates
A quick tutorial to dealing with ZoneOffset and ZoneId in Java.
String Not Empty Test Assertions in Java
Filed under Testing
Learn about different ways of checking for empty Strings in Java
How to Separate Double into Integer and Decimal Parts
Filed under Java Numbers
Have a look at ways to separate integer and decimal parts of a double number in Java.
Java Weekly, Issue 247
Filed under Weekly Review
A primer on managing security when moving a Spring Boot app to the Google Cloud Platform, and the new Spring Data JDBC module looks promising. A solid week.
Find the Registered Spring Security Filters
Filed under Spring Security
Learn how to find all the registered Spring Security filters in an application.
Hibernate 5 Naming Strategy Configuration
Filed under Persistence
Learn about the relationship between the Implicit and Physical Naming Strategies.
Round Up to the Nearest Hundred in Java
Filed under Algorithms
Learn how to round a number up to the nearest hundred in Java
Unsatisfied Dependency in Spring
Filed under Spring
An overview of the most common reasons for getting UnsatisfiedDependencyException, and how to fix it
Guide to AWS Aurora RDS with Java
A quick and practical guide to AWS Aurora RDS with Java.
Mapping A Hibernate Query to a Custom Class
Filed under Persistence
Learn how to map query results into custom objects with Hibernate
Guide to java.lang.Process API
Filed under Java
A quick and practical guide to Java Process API.
Serverless Functions with Spring Cloud Function
Filed under Spring Cloud
Learn how to go serverless with Spring and using Spring Cloud Functions and deploying to AWS Lambda.
Building a Data Pipeline with Flink and Kafka
Filed under Data
Learn how to process stream data with Flink and Kafka
Spring Data – CrudRepository save() Method
Filed under Spring Data
Learn how to save and update entities to a database using Spring Data CrudRepository.
Convert Double to String, Removing Decimal Places
Filed under Java Numbers
Learn how to convert a Double to a String while removing the fractional digits using a number of different approaches.
Java Weekly, Issue 246
Filed under Weekly Review
Native support for the maven surefire and failsafe plugins finally comes to JUnit 5, plus a fresh look at the four pillars of continuous testing.
Get the Key for a Value from a Java Map
Filed under Java Map
Learn how to retrieve a key from a Java Map given the value
A Guide to OptaPlanner
Filed under Algorithms, Java
An introduction to the OptaPlanner library with a basic example of optimizing resource planning
Ratpack HTTP Client
Filed under HTTP Client-Side
Learn how to respond to HTTP requests asynchronously using the Ratpack HttpClient.
Spring Security – Whitelist IP Range
Filed under Spring Security
Learn how to whitelist an IP range in a Spring Security configuration.
Using Lombok’s @Getter for Boolean Fields
Filed under Java
Learn the convenience that Lombok’s @Getter annotation adds, as well as some of its nuances with Boolean types
Spring Vault
Learn about what Spring has to offer when working with Vault – a popular tool to store and secure secrets
Guide to Jakarta EE JTA
Filed under Jakarta EE, Persistence
Learn how to execute multi-resource transactions with Jakarta EE JTA.
Spring WebSockets: Send Messages to a Specific User
Filed under Spring
Learn how to send STOMP messages to a specific user in Spring WebSockets.
Permgen vs Metaspace in Java
Filed under JVM
Learn about the differences between the PermGen and Metaspace memory regions in Java
Convert java.util.Date to String
Filed under Java Dates
Learn several methods for converting Date objects to String objects in Java.
Java Weekly, Issue 245
Filed under Weekly Review
Another busy week, as this installment features a great introduction to Spring Boot Actuators and a powerful factory pattern for building test objects.
Calculate the Distance Between Two Points in Java
Filed under Algorithms
A quick Java solution for a simple math problem of finding the distance between two points
Remove Emojis from a Java String
Filed under Java String
Have a look at ways to remove emojis from a text in Java
Load Spring Boot Properties From a JSON File
Filed under JSON, Spring Boot
Learn how to load configuration properties for Spring Boot from a JSON file
Time Complexity of Java Collections
Filed under Java Collections
Learn about the time complexity for common operations on Java collections
Add a Character to a String at a Given Position
Filed under Java String
Learn how to change a String by inserting a new character at an arbitrary position.
Set a Response Body in JAX-RS
Filed under Jakarta EE, REST
Learn how to set the JAX-RS response body for various media types
Check if a String Contains All the Letters of the Alphabet With Java
Filed under Java String
A brief guide on checking whether a text contains all letters of the alphabet.
Find the Intersection of Two Lines in Java
Filed under Algorithms, Java
A quick take on a Java solution for a simple math problem
Configuring a Tomcat Connection Pool in Spring Boot
Filed under Persistence, Spring Boot
Learn how to configure a Spring Boot JPA application to use the Tomcat JDBC Connection Pool.
@JoinColumn Annotation Explained
Filed under JPA
Learn what JPA’s @JoinColumn annotation is all about
Java Primitives Versus Objects
Filed under Core Java
A quick and practical comparison of objects and primitives in Java.
A Guide to Apache Crunch
Filed under Data
A quick guide to creating data pipelines with Apache Crunch.
Java Weekly, Issue 244
Filed under Weekly Review
This issue is full of JPA and Hibernate centered offerings, along with a great pattern for extracting data-rich services from a monolith. A good week.
Reactive JAX-RS Client API
Filed under HTTP Client-Side, Jakarta EE, Reactive
Learn different ways of creating reactive clients with JAX-RS
Working With Custom HTML Attributes in Thymeleaf
Filed under Spring MVC
Explore how to define custom attributes in HTML5 tags using Thymeleaf.
JBoss Server – How to Start and Stop?
Filed under DevOps, Jakarta EE
Explore how to start and stop a JBoss server with different configurations.
Overview and Need for DelegatingFilterProxy in Spring
Filed under Spring MVC
Learn how to use Spring’s DelegatingFilterProxy to implement servlet filters
Throw Exception in Optional in Java 8
Filed under Java
Explore how to throw an exception from Java 8 Optional.
Spring Application Context Events
Filed under Spring
Learn about the built-in events for the Spring application context
ClassCastException: Arrays$ArrayList cannot be cast to ArrayList
Filed under Java Collections
Learn how to avoid a ClassCastException when working with various Java List implementations.
Guide to Lucene Analyzers
Have a look at the most common Lucene Analyzers and how to use them to search and analyze text.
Spring Autowiring of Generic Types
Filed under Spring
Injection of generics is a powerful feature, making code cleaner and much more understandable. In this article we cover autowiring these generics in Spring.
Spring Security Login Page with Angular
Filed under Spring Security
Learn how to implement a Spring Security login page with Angular.
Java Check a String for Lowercase/Uppercase Letter, Special Character and Digit
Filed under Java String
Learn how we to check if a String contains at least one uppercase letter, lowercase letter, digit or special character in Java.
Java Weekly, Issue 243
Filed under Weekly Review
A productive week, as we see a clever use of the JUnit 5 Extension Model, and a library developer makes a strong case for migrating to Java modules.
Difference Between Flatmap and Switchmap in RxJava
Filed under Reactive
Learn when to use flatmap and when to use switchmap with RxJava
Save Data to a JSON File with Gson
Filed under JSON
Learn how to convert Java Objects into JSON and write them into a File
Difference Between Throw and Throws in Java
Filed under Core Java
Explore the difference between two Java keywords: throw and throws.
Spring Component Scanning
Filed under Spring Boot
Learn about the mechanism behind Spring component scanning, and how you can tweak it to your own needs
Jetty Configuration in Eclipse
Filed under IDE
A comprehensive tutorial to getting started with the Jetty plugin in Eclipse.
Mock Static Method using JMockit
Filed under Testing
Learn how to mock static methods in Java using the JMockit library.
Removing the First Element of an Array
Filed under Java Array
Have a look at ways to remove the first element of an array in Java
Hibernate Entity Lifecycle
Filed under Persistence
An overview and explanation of the states Hibernate entities go through in their lifecycle
Spring Data Composable Repositories
Filed under Spring Data
Learn how to use multiple fragments to implement a Spring Data repository
Java Constructors vs Static Factory Methods
Filed under Core Java
Learn about static factory methods in Java and why they’re sometimes preferred over constructors for instantiating and initializing objects.
Tomcat Configuration in Eclipse
Filed under IDE, Jakarta EE
A detailed tutorial to configuring Tomcat in Eclipse.
Overview of JSON Pointer
Filed under JSON
Learn how to use JSON Pointer to access, read, and update JSON data.
An Overview of Regular Expressions Performance in Java
Filed under Java
Explore how the pattern-matching engine works in Java.
Java Weekly, Issue 242
Filed under Weekly Review
Some great writeups on Spring Boot, distributed systems, and cloud services, including a clever methodology for protecting cloud API credentials. A good week.
Deploy a WAR File in JBoss
Filed under Jakarta EE
Learn about the different ways to deploy a WAR file on JBoss
Java List Initialization in One Line
Filed under Java Collections
In this quick tutorial, we’ll investigate how can we initialize a List using one-liners.
Static and Dynamic Binding in Java
Filed under Core Java
An exploration of how Java handles binding method names for lookup at runtime.
Differences Between Final, Finally and Finalize in Java
Filed under Core Java
Learn the difference between the Final, Finally and Finalize keywords in Java
Performance of contains() in a HashSet vs ArrayList
Filed under Java Collections
Learn about the performance differences between ArrayList.contains() and HashSet.contains()
Running JUnit Tests in Parallel with Maven
A quick tutorial to running parallel tests using JUnit and Maven, for single and multi-module projects.
Read a File into an ArrayList
Filed under Java IO
A quick tutorial to reading files into ArrayLists in Java
Change the Default Port in WildFly
Filed under DevOps, Jakarta EE
Learn how to change the default port in WildFly.
Increase Heap Memory for WildFly
Filed under DevOps, Jakarta EE
Learn how to modify the heap size for WildFly.
Initialize a HashMap in Java
Filed under Java Map
Explore the various ways of initializing a Map, particularly to create empty, singleton, immutable and mutable maps.
Testing an Abstract Class With JUnit
Filed under Testing
Learn about specifics of unit testing abstract classes, covered with examples and pros/cons.
Collections.emptyList() vs. New List Instance
Filed under Java Collections
Learn the differences between the Collections.emptyList() and a new list instance.
Introduction to Hazelcast Jet
Filed under Data, Persistence
Learn how to use Hazelcast Jet to process stream data.
Server-Sent Events (SSE) in JAX-RS
Filed under Jakarta EE
A brief tutorial to configuring Server-Sent Events using JAX-RS.
Default Password Encoder in Spring Security 5
Filed under Spring Security
Learn how to avoid the IllegalArgumentException when migrating plaintext passwords to Spring Security 5
Running JUnit Tests Programmatically, from a Java Application
Filed under Testing
A quick tutorial on running JUnit tests from your Java code
Why String Is Immutable in Java?
Filed under Java String
Explore why Strings in the Java language are immutable.
Set the Time Zone of a Date in Java
Filed under Java Dates
Learn how to set the time zone of a date in Java 7, Java 8 and Joda-Time
Concurrent Strategies using MDBs
Filed under Jakarta EE
Learn some best practices for working with Message-Driven Beans.
Java Weekly, Issue 241
Filed under Weekly Review
This edition is chock full of advice for getting more out of your logs, plus an interesting piece on simulating localization to strengthen your UI development.
Custom Validation MessageSource in Spring Boot
Filed under Spring Boot
Learn how to register a custom MessageSource for validation messages in Spring Boot.
Thread Safe LIFO Data Structure Implementations
Filed under Java Collections, Java Concurrency
A simple tutorial to using LIFO Data Structures in concurrent environments.
A Simple E-Commerce Implementation with Spring
Filed under Spring Boot
Explore how to create a simple e-commerce application, using Spring Boot and Angular frameworks.
java.util.Date vs java.sql.Date
Filed under Java Dates
Learn about the differences between java.util.Date and java.sql.Date.
Java Null-Safe Streams from Collections
Filed under Java Streams
Explore how to create a null-safe stream from a given collection.
MQTT Client in Java
Filed under Data
Learn how to use the Paho library to send an receive messages from an MQTT broker in a Java application,
Creating a Custom Log4j2 Appender
Filed under Logging
Learn how to create a custom logging appender for Log4j2.
Logging Exceptions Using SLF4J
Filed under Logging
Quick overview of exception logging with SLF4J logging abstraction
Java Weekly, Issue 240
Filed under Weekly Review
Good writeups on testing microservices this week, while several Spring projects get new releases. And Eclipse users will be excited about the Photon release.
Spring MVC Streaming and SSE Request Processing
Filed under Spring MVC
Learn how to produce asynchronous and streaming data responses using Spring MVC 5 and consume them with a simple AJAX client.
A Simple Guide to Connection Pooling in Java
Filed under Persistence
A quick overview of several popular connection pooling solutions, plus a quick dive into a custom connection pool implementation
A Guide to JavaFaker
Filed under Testing
Learn how to generate data using the JavaFaker library.
Parsing YAML with SnakeYAML
Filed under Java
An overview of parsing simple and not so simple YAML documents into Java objects – and vice versa – using SnakeYAML library.
Add Multiple Items to an Java ArrayList
Filed under Java Collections
Explore different ways of adding multiple items to an already initialized ArrayList.
Auto-import Classes in IntelliJ
Filed under IDE
A brief article describing the different options of IntelliJ IDEA’s ‘auto-import’ feature.
Spring Session with JDBC
Filed under Spring Persistence
Learn how you can seamlessly persist your session information into a database using Spring Session JDBC
Remove the First Element from a List
Filed under Java Collections
A quick overview of a few ways of removing the first element from a list in Java.
Vue.js Frontend with a Spring Boot Backend
Filed under Spring Boot
Explore how to set up a web application using Spring Boot and Vue.js.
Spring @Primary Annotation
Filed under Spring
Learn how to use Spring’s @Primary annotation to give preference to beans when autowiring
Overriding System Time for Testing in Java
Filed under Testing
Explore different ways to override the system time for testing.
Java Weekly, Issue 239
Filed under Weekly Review
An excellent write-up on garbage collection, and a set of strategies for zero-downtime schema updates that you won’t want to miss. A good week.
Mockito.mock() vs @Mock vs @MockBean
Learn the differences between different types of Mocking with Mockito.
A Guide to SqlResultSetMapping
Filed under JPA
Learn how to use JPA’s SqlResultSetMapping to map database results to Java objects
Query Entities by Dates and Times with Spring Data JPA
Filed under Java Dates, Spring Data
Learn how to query entities using their dates and times fields with Spring Data JPA.
Getting a File’s Mime Type in Java
Filed under Java IO
An overview of various ways to get a file’s MIME type
A Guide to Eclipse JNoSQL
Filed under NoSQL
Learn how to use Eclipse JNoSQL to work with NoSQL databases
A Guide to Message Driven Beans in EJB
Filed under Jakarta EE
In this article, we’ll discuss Message Driven Beans (MDB), responsible for handling message processing in an asynchronous context.
How to Trigger and Stop a Scheduled Spring Batch Job
Filed under Spring
Explore three different ways to trigger and stop a scheduled Spring Batch job.
Initializing HashSet at the Time of Construction
Filed under Java Collections
Explore multiple ways to initialize a HashSet while it’s constructed.
Guide to Apache Avro
Filed under Data
Learn how to use the Apache Avro serialization library.
Spring Webflux and CORS
Filed under Spring Web
A quick and practical guide to working with CORS and Spring Webflux.
Build a Jar with Maven and Ignore the Test Results
Filed under Maven
Learn different ways to build a jar with maven and ignore the test results
Test a REST API with curl
Filed under REST
Learn how to test HTTP GET, POST, PUT, and DELETE using curl
Guide to JMapper
Filed under Data
Explore the JMapper library for mapping attributes between source and destination beans.
Uploading MultipartFile with Spring RestTemplate
Filed under HTTP Client-Side, Spring Web
Learn how to upload files using Spring’s RestTemplate.
Java Weekly, Issue 238
Filed under Weekly Review
This week, a lot of low-level stuff, Graal, evolution of caching at Netflix, and basics of Garbage Collector optimization.
Spring REST and HAL Browser
Discover how to explore REST APIs using a HAL browser.
Common Java Exceptions
Filed under Core Java
A quick overview to the common Java Exceptions.
Copy a List to Another List in Java
Filed under Java Collections
Explore different ways to copy a List to another List in Java and a common error produced in the process.
Handling Errors in Spring WebFlux
Filed under Reactive, Spring Web
Have a look at different methods to gracefully handle errors in Spring Webflux.
Guide to Spring 5 WebFlux
Filed under HTTP Client-Side, Reactive, Spring Web
A brief guide to using WebFlux with annotations, in Spring 5.
@Component vs @Repository and @Service in Spring
Filed under Spring
Learn about the differences between the @Component, @Repository and @Service annotations and when to use them.
Increment Date in Java
Filed under Java Dates
An overview of various core and 3rd party methods for adding days to a date
Java Weekly, Issue 237
Filed under Weekly Review
Some great writeups this week on JPA and Hibernate, using Spring Boot in the GraalVM, and an engineering approach to testing distributed systems. A good week.
Stack Memory and Heap Space in Java
Filed under JVM
Explore how Stack Memory and Heap Space works and when to use them for developing better Java programs.
Guide to java.util.GregorianCalendar
Filed under Java Dates
Learn how to use Java’s GregorianCalendar class
Context and Servlet Initialization Parameters
Filed under Jakarta EE
Learn how to define and access context and servlet initialization parameters in a Java HTTP servlet application.
Java Global Exception Handler
Filed under Java
Learn how to globally handle all uncaught exceptions in your Java application
Building a Microservice with Apache Meecrowave
Filed under REST
Learn how to use Apache Meecrowave to create a microservice
Create a Symbolic Link with Java
Filed under Java IO
Learn about symbolic links, and how to create them with Java
How to Set a Header on a Response with Spring 6
Filed under Spring Web
Learn how to set a header on a specific response or on all response in Spring.
Guide to Resilience4j
Learn how to use the most useful modules from the Resilience4j library to build resilient systems.
Encrypting and Decrypting Files in Java
Use CipherInputStream and CipherOutputStream classes to encrypt and decrypt files in Java.
Monitoring Disk Usage and Other Metrics in Java
Filed under DevOps
A quick and practical guide to monitoring key metrics in Java.
How to Get the Size of an Object in Java
Filed under Core Java
A quick and practical guide to getting object’s size in Java.
Java Weekly, Issue 236
Filed under Weekly Review
Some great writeups this week, as ACID transactions arrive in Spring Data MongoDB, plus a brief look at a clever language for achieving attribute-based access control in Spring Security.
Exception Handling in Java
Filed under Core Java
Learn the basics of exception handling in Java as well as some best and worst practices.
Calculate Age in Java
Filed under Java Dates
Learn how to easily calculate age in Java 7, Java 8, and with Joda-Time
Read and Write User Input in Java
Filed under Java IO
Learn how to get user input and handle user output with the console in a Java application.
Introduction to GWT
Filed under Java
Learn how to create a simple web application using GWT.
Quick Use of FilenameFilter
Filed under Java IO
Learn about FilenameFilter, a functional interface for filtering on a list of files by name.
Iterating Backward Through a List
Filed under Java Collections
Learn about various ways you can iterate through a list backwards, including some popular third-party libraries
Spring Boot with Multiple SQL Import Files
Filed under Spring Boot, Spring Persistence
Learn how to configure Spring Boot application to load initial data from custom SQL files.
Spring AMQP in Reactive Applications
Filed under Reactive, Spring Persistence, Spring Web
Learn how to create a Spring Boot Reactive Application that integrates with the RabbitMQ messaging server, an implementation of the AMQP messaging standard.
Create a Custom Exception in Java
Filed under Core Java
Learn how to define custom exceptions in Java.
Spring Boot Console Application
Filed under Spring Boot
Learn how to create a Spring Boot console application
Converting Between Roman and Arabic Numerals in Java
Filed under Algorithms, Java Numbers
Learn how to convert between Roman and Arabic numerals using Java
Extracting Year, Month and Day from Date in Java
Filed under Java Dates
A quick guide to extracting date parts using the new LocalDate class, and the legacy API.
How to Get the Start and the End of a Day using Java
Filed under Java Dates
Explore different ways of getting the start and end of a day in Java.
Spring with Thymeleaf Pagination for a List
Filed under Spring MVC
Learn how to leverage Thymeleaf and Spring Data Commons to paginate through a list of items in your Spring Web UI.
Java Weekly, Issue 235
Filed under Weekly Review
A wide range of topics in the Java ecosystem, from speeding up JPA associations to distributed tracing, and a peek at the evolution of value types. A good week.
The DAO Pattern in Java
Filed under Persistence
Learn how to implement the Data Access Object (DAO) pattern in Java to isolate the persistence and business layers of your application.
Importance of Main Manifest Attribute in a Self-Executing JAR
Learn how to create a self-executing JAR by specifying the main class as an attribute in the Manifest file.
Guide to Maven Archetype
Filed under Maven
Learn what Maven archetypes are used for, and how you can create your own
Java with ANTLR
Filed under Java
Learn how to parse and process structure text and languages with ANTLR in Java
An Introduction to CDI (Contexts and Dependency Injection) in Java
Filed under Jakarta EE
Have a a look at CDI’s most relevant features and implement different approaches for injecting dependencies in client classes.
How to Get the File Extension of a File in Java
Filed under Java IO
Learn how to obtain the file extension programmatically in Java.
Immutable Objects in Java
Filed under Core Java
Learn about immutability and how you can achieve it in a Java object.
Introduction to JavaPoet
Filed under Java
Learn how you can generate Java code with the JavaPoet library
Introduction to Joda-Time
Filed under Java Dates
Learn about the most widely used date and time processing library, before the release of Java 8 – Joda-Time.
Docker Test Containers in Java Tests
Filed under Docker
A guide to implementing integration tests with docker test containers in JUnit tests.
Java System.getProperty vs System.getenv
Filed under Java
Learn exactly how to use getProperty and getenv with java.lang.System.
Spring 5 Tutorial
Learn all about the new functionality in Spring 5.
Optimistic Locking in JPA
Filed under JPA
A guide to understanding optimistic locking in JPA as well as its use cases.
Jakarta EE Servlet Exception Handling
Filed under Jakarta EE
Learn how to handle exceptions in a Jakarta EE Servlet application.
A Guide to DeltaSpike Data Module
Filed under Persistence
Explore the DeltaSpike Data module to simplify the implementation of the repository pattern.
Working with Select and Option in Thymeleaf
Filed under Spring MVC
Learn how to handle a common case of using Select with Option tags in Thymeleaf.
Java Weekly, Issue 234
Filed under Weekly Review
Busy week for upgrades, especially in the Spring ecosystem, plus a cool write-up on a fast and lean Java collections library.
Access a File from the Classpath in a Spring Application
Filed under Spring
Learn how to easily open and read a file on the classpath using Spring’s Resource API
Implementing a FTP-Client in Java
Filed under Java IO
Learn how to easily interact with an external FTP server in Java.
Front-End App with Spring Security OAuth – Authorization Code Flow
Filed under Spring Security
Explored building a simple front-end application to use with the Authorization Code flow – with Spring Boot, Spring Security and Angular 6.
Count with JsonPath
Filed under JSON
Learn how to use JsonPath to count objects in a JSON structure
Spring Shutdown Callbacks
Filed under Spring
Learn how to run logic before shutdown in Spring
Controlling Bean Creation Order with @DependsOn Annotation
Filed under Spring
This tutorial explores managing Spring initialization order using the @DependsOn annotation
Multi-Module Project With Spring Boot
Filed under Maven, Spring Boot
Learn how to create a Spring Boot library JAR as a Maven module and use it in a Spring Boot application module.
Bootstrapping JPA Programmatically in Java
Filed under Persistence
Learn how to configure a JPA persistence context in Java without the traditional persistence.xml file.
Java Weekly, Issue 233
Filed under Weekly Review
Interesting Java 10 functionality as well as notes on what’s happening with Jakarta EE, plus Zuul 2 finally being open sourced. A good week all around.
JUnit Tutorial
Learn to use JUnit to the full extent of its capabilities.
Generalized Target-Type Inference in Java
Filed under Java
Explore Java’s Type Inference, that along with generics and Lambda Expression enables us to write concise Java code.
Guide to the java.util.Arrays Class
Filed under Java Array
Learn what features java.util.Arrays has, including what’s new from Java 8
Histograms with Apache Commons Frequency
Filed under Algorithms
Explore the Frequency class of Apache commons-math3 library.
Jakarta EE 8 Security API
Filed under Jakarta EE, Security
Learn how to use the Java 8 API to add security to a JEE application.
Binding a List in Thymeleaf
Filed under Spring MVC
Learn how to bind a list of objects to form input in Thymeleaf
Learn Spring Boot
Filed under Series, Spring Boot
Learn Spring Boot, from the core concepts to the advanced scenarios you can implement with the framework.
Multi-Dimensional Arrays in Java
Filed under Java Array
Learn how to work with multi-dimensional arrays in Java
REST Query Language Over Multiple Tables with Querydsl Web Support
A quick guide to using Querydsl to querying over HTTP associated entities.
Spring Security OAuth 2 Guides
Filed under Series, Spring Security
Learn all about OAuth with Spring Security.
Java Weekly, Issue 232
Filed under Weekly Review
Starting with DB-centric design, through the new JDK 9 and 10 Collection improvements and finishing up with how to store credentials correctly – good stuff overall.
JUnit5 Programmatic Extension Registration with @RegisterExtension
Filed under Testing
An overview of JUnit 5 @RegisterExtension annotation along with examples of use
Mockito ArgumentMatchers
Filed under Testing
Learn how to use the ArgumentMatcher and how it differs from the ArgumentCaptor.
Difference Between JVM, JRE, and JDK
Filed under JVM
A guide to understanding the difference between JVM, JRE, and JDK in Java.
Spring – Injecting Collections
Filed under Spring
Learn how to inject different types of Java collections using the Spring framework.
Performance of Java Mapping Frameworks
Filed under Data
Compare the performance of the most popular Java mapping frameworks.
The Thread.join() Method in Java
Filed under Java Concurrency
Learn how to use the Thread.join() methods for thread synchronization.
Spring Data Reactive Repositories with MongoDB
Filed under NoSQL, Spring Data
Learn how you can use Spring’s reactive repositories with MongoDB at the persistence end
Returning a JSON Response from a Servlet
Filed under Jakarta EE, JSON
Learn how to create a JSON response from a Servlet
Guide to the super Java Keyword
Filed under Core Java
Learn how to use Java’s super keyword to reference the parent class.
Guide to the this Java Keyword
Filed under Core Java
Learn how to use Java’s this keyword to reference the current object.
A Guide to Spring Data Key Value
Filed under Spring Data
Learn how to use Spring Data Key Value to interact with key-value stores
Java Weekly, Issue 231
Filed under Weekly Review
This week, migrating from Java to Kotlin and to Java again, exploring Spring Boot testing, and reinventing the calendar.
Example of Downloading File in a Servlet
Filed under Jakarta EE
A simple example of creating a downloadable file and serving it from a Java Servlet application.
Spring Data REST Events with @RepositoryEventHandler
Filed under REST, Spring Data
Learn how to handle entity events in Spring Data REST.
Download a File From an URL in Java
Filed under Java IO
Explore the different ways of downloading a file in Java.
Use char[] Array Over a String for Manipulating Passwords in Java?
Filed under Security
Explore several reasons why we shouldn’t use Strings for storing passwords and use char[] arrays instead.
Context Hierarchy with the Spring Boot Fluent Builder API
Filed under Spring Boot
Create a context hierarchy in Spring Boot – using the Builder API.
Working With Arrays in Thymeleaf
Filed under Spring MVC
Learn how to use arrays in the Thymeleaf template engine.
Pessimistic Locking in JPA
Filed under JPA
A quick guide to using pessimistic locking in JPA
Spring RestTemplate Error Handling
Filed under HTTP Client-Side, Spring Web
Learn how to handle errors with Spring’s RestTemplate
Using the Spring RestTemplate Interceptor
Filed under HTTP Client-Side, Spring Web
Learn about using interceptors in your Spring application with the RestTemplate.
Getting the Size of an Iterable in Java
Filed under Java Collections
Learn different ways to get the size of an Iterable in Java
Infinite Loops in Java
Filed under Core Java
Learn about the various ways to create infinite loops in Java
Spring Boot Configuration with Jasypt
Filed under Spring Boot
Enable Jasypt to encrypt configuration file attributes in a Spring Boot application for decrypting and use at runtime.
Guide to JNI (Java Native Interface)
Filed under Java
Understand JNI and the ability to bridge Java Bytecode with native C++.
Java main() Method Explained
Filed under Core Java
Learn about the standard Java main() method along with some uncommon, but still supported, ways of writing it.
Java Weekly, Issue 230
Filed under Weekly Review
This week, a lot of Docker-related write-ups, and a cool piece about the importance of experience diversity provided by engaging in side-projects.
NaN in Java
Filed under Java
Understand the NaN – “not a number” value in Java.
Introduction to Java Microservices with MSF4J
Get started building Java-based microservices with MSF4J
Singleton Session Bean in Jakarta EE
Filed under Jakarta EE
An exploration on applying a Singleton when using Session Beans.
Access Modifiers in Java
Filed under Core Java
Learn about Java’s access modifiers
Uploading Files with Servlets and JSP
Filed under Jakarta EE
Have a look at a file upload example with servlets and JSP.
Deploy a Spring Boot WAR into a Tomcat Server
Filed under DevOps, Spring Boot
Learn how to configure a Spring Boot application to be deployed on a Tomcat server.
Variable and Method Hiding in Java
Filed under Core Java
Understand the concept of hiding of variables and methods in Java.
Java Weekly, Issue 229
Filed under Weekly Review
This week, Spring Boot 2.0 and metrics, a deep insight into Gradle performance testing, and a cool write-up about problems related to running Java in Docker.
Java Optional – orElse() vs orElseGet()
Filed under Core Java
Explore the differences between Optional orElse() and OrElseGet() methods.
Interoperability Between Java and Vavr
Filed under Java
Have a look at how to convert between standard Java and Vavr data structures.
Guide to the Favicon in Spring Boot
Filed under Spring Boot, Spring MVC
Learn how to customize the favicon in a Spring Boot application.
Working with XML Files in Java Using DOM Parsing
Filed under XML
Learn how to parse an XML document using Xerces DOM parsing.
Spring Boot Exit Codes
Filed under Spring Boot
Learn how to provide custom exit codes in your Spring Boot application
Hamcrest Common Core Matchers
Filed under Testing
Explore the different methods of CoreMatchers class in the Hamcrest library.
Check If a String Is Numeric in Java
Filed under Java String
Explore different ways to determine whether a String is numeric or not.
Spring Custom Property Editor
Filed under Spring MVC
Have a look at how you can convert between Strings and custom objects in Spring.
Composite Design Pattern in Java
Filed under Java
Have a look at how to implement the composite design pattern in Java.
Guide to DeferredResult in Spring
Filed under Spring MVC
Learn how to perform asynchronous request processing in Spring MVC using DeferredResult.
The Tomcat java.net.BindException: Address Already in Use Error in Java
Filed under DevOps
Find out what causes the common java.net.BindingException Error: Address already in Use and how to handle it.
Java Weekly, Issue 228
Filed under Weekly Review
This week is short and sweet, with some cool writeups in between.
Lightweight Ethereum Clients Using Web3j
Learn how to interact with the Ethereum network with the Web3j library.
The Command Pattern in Java
Filed under Java
Learn how to implement the Command Pattern in Java using object-oriented and object-functional approaches.
Pass-By-Value as a Parameter Passing Mechanism in Java
Filed under Core Java
Learn how parameter passing is handled in Java for the cases of Primitive and Object types.
Run an Ant Task with Maven
Filed under Maven
Learn how you can easily invoke Ant tasks from your Maven build
Spring Cache – Creating a Custom KeyGenerator
Filed under Spring
Learn how to implement a custom Spring Cache KeyGenerator.
All About String in Java
Filed under Java String, Series
Learn all about working with Strings in Java.
Java IO Tutorials
Learn about and explore the full IO capabilities in Java.
Java Collections
Filed under Java Collections, Series
Learn all about Java Collections.
Java Concurrency
Filed under Java Concurrency, Series
Explore Concurrency in Java.
Java Streams
Filed under Java Streams, Series
The Full Guide to Java Streams.
Managing Amazon SQS Queues in Java
Filed under Cloud
Learn how to use the Amazon Simple Queue Service (SQS) to manage message queues in Java.
@Order in Spring
Filed under Spring
A quick overview of Spring’s @Order annotation with a simple example
Guide to the Java Clock Class
Filed under Java Dates
Learn about the use cases of the Java Clock class.
Java Service Provider Interface
Filed under Java
Have a look at the components of the Java Service Provider Interface with a practical use case.
Java Weekly, Issue 227
Filed under Weekly Review
This week, GraalVM, a bit of JDK 11, and a cool write-up about the Kotlin collections.
Java Streams vs Vavr Streams
Filed under Java Streams
A comprehensive overview of two different Stream implementations.
BeanNameAware and BeanFactoryAware Interfaces in Spring
Filed under Spring
Have a look at working with the BeanNameAware and BeanFactoryAware interfaces in Spring.
Spring Data JPA @Query
Filed under Spring Data
Learn how to use the @Query annotation in Spring Data JPA to define custom queries using JPQL and native SQL.
Projections and Excerpts in Spring Data REST
Filed under REST, Spring Data
Create custom views of entities in Spring Data REST using projections and excerpts.
A Quick Example of Spring Websockets’ @SendToUser Annotation
Filed under Spring
A quick and practical guide to Spring 5’s @SendToUser annotation.
Service Locator Pattern and Java Implementation
Filed under Algorithms
Learn about the service locator pattern and how to implement it in Java.
How to Define a Spring Boot Filter?
Filed under Spring Boot
A quick and practical guide on defining a custom Spring Boot filter.
Sending Emails with Java
Filed under Java
Learn how to use the native Java mail library to send emails with and without attachments.
Iteration in Thymeleaf
Filed under Spring MVC
Learn how to use iteration with Thymeleaf using the th:each attribute.
Introduction to Primefaces
Filed under Jakarta EE
Learn the basics of the Primefaces UI toolkit with demonstrations of some of its main features.
How to Find an Element in a List with Java
Filed under Java Collections
Have a look at some quick ways to find an element in a list in Java
A Quick Intro to the SpringBootServletInitializer
Filed under Spring Boot
Configure a Spring Boot app that’s packaged as a WAR using the SpringBootServletInitializer.
Java Concurrency Utility with JCTools
Filed under Java Concurrency
Learn how to implement non-blocking, concurrent data structures with the JCTools library
Java Weekly, Issue 226
Filed under Weekly Review
This week, among others, OracleCodeOne announcement, JDK 11 schedule, and a comprehensive write-up about breaking a monolith.
Spring MVC @PathVariable with a dot (.) gets truncated
Filed under Spring MVC
Learn how to handle path variables that contain a dot in Spring MVC request mappings.
Intro to Apache OpenNLP
Filed under Algorithms
Learn how to implement the most important natural language processing tasks with Apache OpenNLP
Spring WebFlux Filters
Filed under Reactive, Spring Web
Learn how to modify requests and responses using Spring Webflux Filters
Introduction to SSL in Java
Filed under Security
A quick and practical introduction to SSL in Java.
Testing Netty with EmbeddedChannel
Filed under Testing
Learn how to use EmbeddedChannel to test the functionality of the inbound and outbound channel handlers.
Find All Pairs of Numbers in an Array That Add Up to a Given Sum in Java
Filed under Algorithms, Java Array
A quick look at several algorithms for finding pairs of numbers in an array that add up to a given sum in Java using traditional for loops and the Java 8 Stream API.
Spring Assert Statements
Filed under Spring
A quick guide to using Spring Assert statements.
Apache Ignite with Spring Data
Filed under Spring Persistence
Learn how to integrate the Apache Ignite project with the Spring Data API.
EasyMock Argument Matchers
Filed under Testing
Explore argument matchers in the EasyMock library.
Measure Elapsed Time in Java
Filed under Java Dates
Learn different ways to measure elapsed time in Java
Java Weekly, Issue 225
Filed under Weekly Review
This week, a lot of Spring material, JWM internals, and a cool write-up about FP vs OOP.
A Guide to Apache Ignite
Filed under Persistence
A quick and practical guide to Apache Ignite.
Obtaining Auto-generated Keys in Spring JDBC
Filed under Spring Persistence
A quick and practical guide to getting autogenerated keys when working with Spring JDBC.
Spring Boot: Configuring a Main Class
Filed under Spring Boot
Learn how to configure your Spring Boot application’s main class in Maven and Gradle.
Servlet Redirect vs Forward
Filed under Jakarta EE
Learn how to perform redirects and forwards using Java Servlets and the difference between them.
Facade Design Pattern in Java
Filed under Java
Learn how to apply the Facade design pattern in Java.
Spring Boot Change Context Path
Filed under Spring Boot
Learn various ways of changing the context path in your Spring Boot application
Working with Fragments in Thymeleaf
Filed under Spring MVC
Learn how to create reusable view components with Thymeleaf fragments to simplify template management.
Conditionals in Thymeleaf
Filed under Spring MVC
Learn about the different types of Thymeleaf conditionals.
Java List UnsupportedOperationException
Filed under Java Collections
Have a look at the UnsupportedOperationException and how to avoid it when working with lists in Java.
An Overview of the JVM Languages
Filed under JVM
A high-level look at the most popular JVM languages
Internationalization and Localization in Java 8
Filed under Java
Have a look at the Java 8 support for internationalizing and localization of an application.
Spring Boot: Customize Whitelabel Error Page
Filed under Spring Boot
Learn how to customize the default error page in a Spring Boot application.
@Lookup Annotation in Spring
Filed under Spring
Learn how to effectively use the @Lookup annotation in Spring for procedural injection.
Assert an Exception Is Thrown in JUnit 4 and 5
Filed under Testing
Have a look at how to test if an exception was thrown using JUnit.
Quick Guide to java.lang.System
Filed under Core Java
Learn all the cool tips and tricks you never heard of with java.lang.System, like how to redirect System.out and safe use of System.nanoTime
Finding Min/Max in an Array with Java
Filed under Java Array
A quick intro on how to find the min/max value from a given array with the powerful Stream API in Java 8.
Java Weekly, Issue 224
Filed under Weekly Review
This week, a comprehensive list of user authentication tips, a cool write-up about the past StackOverflow decade, and Spring IO Platform EoL announcement.
A Guide to the JSTL Library
Filed under Jakarta EE
A comprehensive overview of the JSTL tag library.
Introduction to Spring Boot CLI
Filed under Spring Boot
Learn how to quickly scaffold Spring micro-services using Spring CLI terminal commands and Groovy scripts.
Spring Boot Gradle Plugin
Filed under Gradle, Spring Boot
Have a look at the Spring Boot Gradle Plugin functionality that helps manage Spring Boot apps built with Gradle.
Inheritance and Composition (Is-a vs Has-a relationship) in Java
Filed under Core Java
Learn the differences between inheritance and composition relationships in Java.
Show Hibernate/JPA SQL Statements from Spring Boot
Filed under Logging, Spring Boot, Spring Persistence
Learn how you can configure logging of the generated SQL statements in your Spring Boot application.
Introduction to JavaFx
Filed under Java
Explore the JavaFX library for building GUI applications in Java.
Spring Security with Thymeleaf
Filed under Spring MVC, Spring Security
A quick guide to integrating Spring Security and Thymeleaf
Class Loaders in Java
Filed under Core Java
Have a look at the behind-the-scenes of loading Java classes during runtime to the JVM.
Filtering Observables in RxJava
Filed under Reactive
A practical reference for filtering Observables in RxJava.
Introduction to EasyMock
Filed under Testing
A quick and practical guide to EasyMock – another mocking library for Java.
New Password Storage in Spring Security 5
Filed under Spring Security
A quick guide to understanding password encryption in Spring Security 5 and migrating to better encryption algorithms.
Java Weekly, Issue 223
Filed under Weekly Review
This week, a bit of Java 10, Hibernate, and some interesting musings about tackling technical debt.
Creating and Deploying Smart Contracts with Solidity
See how to create a Smart Contract and interact with it using Java.
Shutdown a Spring Boot Application
Filed under DevOps, Spring Boot
Have a look at different ways to shut down a Spring Boot Application.
Handling Cookies and a Session in a Java Servlet
Filed under Jakarta EE
Learn how to store user data between subsequent requests to the server, using cookies and a session.
Find Sum and Average in a Java Array
Filed under Java Array
In this quick tutorial, we’ll cover how we can calculate sum & average in an array using both Java standard loops and the Stream API.
Integration Testing with a Local DynamoDB Instance
Filed under NoSQL
Let’s have a look at how we can set up a local DynamoDB instance so that we can use it for integration tests
Command-Line Arguments in Spring Boot
Filed under Spring Boot
Learn how to pass arguments from command line into your Spring Boot application
The Spring @Controller and @RestController Annotations
Filed under REST, Spring MVC
Learn about the differences between @Controller and @RestController annotations in Spring MVC.
Combining Observables in RxJava
Filed under Reactive
Learn several methods for combining Observable sequences in RxJava.
JSON Schema Validation with REST-assured
Filed under HTTP Client-Side, REST, Testing
Validate the JSON response based on a schema using REST-assured.
Headers, Cookies and Parameters with REST-assured
Filed under HTTP Client-Side, REST, Testing
Learn how to set headers, cookies and parameters for requests using REST-assured.
Java IO – Conversions
Learn how to do simple IO conversions in Java.
The “final” Keyword in Java
Filed under Core Java
Learn what the final keyword in Java means when applied to classes, methods, and variables.
Introduction to CheckStyle
Filed under DevOps
Learn how to integrate and configure the Checkstyle plugin in your Java projects.
Introduction to RxRelay for RxJava
Filed under Reactive
A quick and practical introduction to RxRelay.
Build an MVC Web Application with Grails
Filed under Jakarta EE
Learn how to build a Grails web application from scratch
A Quick Guide to the Spring @Lazy Annotation
Filed under Spring
Learn how to lazily instantiate Spring beans using the @Lazy annotation.
Java Weekly, Issue 221
Filed under Weekly Review
First look at Java 10 and a glimpse at what’s next in Java 11.
Getting Started with Java and Zookeeper
Filed under DevOps
Explore the Java API of Apache Zookeeper – a distributed coordination service which eases the development of distributed applications
Using Guava CountingOutputStream
Filed under Java IO
Learn how to use Guava’s CountingOutputStream class
Mapping LOB Data in Hibernate
Filed under Persistence
Learn how to map Large Object Data using Hibernate’s @Lob annotation.
REST-assured with Groovy
Learn how to work with REST-assured using Groovy.
Java 8 Math New Methods
Filed under Core Java
Learn about the new Math methods brought by Java 8
Spring Data with Spring Security
Filed under Spring Data, Spring Security
See how to integrate Spring Data with Spring Security.
Multipart Uploads in Amazon S3 with Java
Filed under DevOps
See how to handle multipart uploads in Amazon S3 with AWS Java SDK.
Introduction to Akka Actors in Java
Filed under Reactive
Learn how to build concurrent and distributed applications using Akka Actors in Java.
Introduction to Apache Curator
Learn how Apache Curator can help you coordinate your services
Guide to the Externalizable Interface in Java
Filed under Core Java
Have a look at Java’s Externalizable interface for custom serialization and deserialization.
Hamcrest File Matchers
Filed under Testing
Take a look at the Hamcrest File Matchers.
Hamcrest Text Matchers
Filed under Testing
Explore Text Matchers in the Hamcrest library.
Java Weekly, Issue 220
Filed under Weekly Review
This week, more Java 10 anticipation, a bit of Spring Boot 2.0, and a cool write-up about feature lifecycle in Java.
Chain of Responsibility Design Pattern in Java
Filed under Spring
Learn about how and when to use Chain of Responsibility in Java
A Guide to Unirest
Filed under HTTP Client-Side
Discover Unirest – a lightweight HTTP client library.
Maven Dependency Scopes
Filed under Maven
A quick and practical guide to dependency scopes in Maven.
Assertions in JUnit 4 and JUnit 5
Filed under Testing
A look at assertions in both JUnit 4 and 5.
Working with JSON in Groovy
Let’s see how we can deal with JSON when programming in Groovy.
Introduction to OpenCSV
Filed under Java IO
A quick intro to how OpenCSV can actually be useful.
Injecting Prototype Beans into a Singleton Instance in Spring
Filed under Spring
Learn how to inject prototype beans into a singleton-scoped bean instance.
RxJava Maybe
Filed under Reactive
A quick and practical introduction to Maybe in RxJava.
A Guide to the ResourceBundle
Filed under Java
It’s always challenging to maintain and extend multilingual applications. This article covers how to use the ResourceBundle to cope with the varieties that come up when you need to provide the same content to different cultures.
An Advanced Tagging Implementation with JPA
Filed under JPA
Take a look at more advanced tagging scenarios with JPA.
Managing EC2 Instances in Java
Filed under DevOps
Learn how to control EC2 instances using the Java SDK.
Java Weekly, Issue 219
Filed under Weekly Review
A quick review, chock-full of interesting Spring talks and writeups, along with a look forward towards Java 10. Really good stuff this week.
Introduction to JSON-Java (org.json)
Filed under JSON
Learn the fundamentals of parsing and manipulating JSON data with the JSON-Java library.
A Custom Task in Gradle
Filed under Gradle
Learn how to create a custom task in Gradle.
RxJava StringObservable
Filed under Reactive
A quick guide to manipulating Strings using RxJava
Security in Spring Integration
Filed under Spring Security
Learn how to use Spring Integration and Spring Security together in an integration flow.
An Intro to Spring Cloud Contract
Filed under Spring Cloud
Learn to write and test Consumer-Driven Contracts using Spring Cloud Contract.
Guide to Inheritance in Java
Filed under Core Java
Learn about the concept of inheritance in Java.
Method Handles in Java
Filed under Java
See how to use MethodHandles in Java.
The Checker Framework – Pluggable Type Systems for Java
Filed under DevOps
Since the Java 8 release, it’s possible to compile programs using Pluggable Type Systems to apply stricter checks than the ones applied by the compiler.
Java Weekly, Issue 218
Filed under Weekly Review
This week, more and more Java 10 (as the release approaches), Spring Boot 2.0 going GA, and an interesting write-up about why we should NOT specialize in particular technical stacks (at least from a high-level point of view).
Combining Publishers in Project Reactor
Filed under Reactive
Let’s have a look at various ways of combining Publishers in Project Reactor
How to Detect the OS Using Java
Filed under Java
Learn how to detect the OS from Java.
An Intro to Spring Cloud Task
Filed under Spring Cloud
Learn how Spring Cloud Task works and how to configure it to log its events in a database.
Code Analysis with SonarQube
Filed under DevOps
Learn how to set up a SonarQube server locally and how to use Quality Gate to define the criteria for the fitness of a project for production release.
Object Type Casting in Java
Filed under Core Java
An overview of type casting in Java, covered with simple and easy to understand examples.
Method Overloading and Overriding in Java
Filed under Core Java
Learn the basics of method overloading and overriding in Java.
Building Microservices with Eclipse MicroProfile
Filed under Cloud, Jakarta EE
Eclipse MicroProfile is an initiative that aims to optimize Enterprise Java for the Microservices architecture. We will use MicroProfile to build a simple RESTful microservice.
A Guide to Infinispan in Java
Filed under Persistence
Learn how you can use Infinispan as a caching solution for your app.
Comparing Strings in Java
Filed under Java String
Take a look at different ways of comparing Strings in Java.
A Simple Tagging Implementation with JPA
Filed under JPA
Learn how you can extend your JPA project with a tagging implementation
RxJava 2 – Flowable
Filed under Reactive
A brief overview of the usage of Flowable in RxJava 2.
Spring Boot Security Auto-Configuration
Filed under Spring Boot, Spring Security
A quick and practical guide to Spring Boot’s default Spring Security configuration.
Java Weekly, Issue 217
Filed under Weekly Review
A monster installment this week, with a lot of solid writeups. Lots of reading material for the weekend.
Shuffling Collections in Java
Filed under Java Collections
Learn how to shuffle various collections in Java.
An Intro to Spring Cloud Security
Filed under Spring Cloud, Spring Security
Let’s take a closer look at Spring Cloud Security features.
Spring ResponseStatusException
Filed under Spring
Learn how to apply status codes to HTTP responses in Spring with ResponseStatusException.
Exploring jrecreate
Filed under DevOps
Learn how to create platform-specific embedded JREs with the jrecreate tool provided with EJDK
WebSockets with AsyncHttpClient
Filed under Jakarta EE
Let’s see how to handle WebSockets using AsyncHttpClient.
Create a Sudoku Solver in Java
Filed under Algorithms
Building a Sudoku puzzle and an efficient algorithm used for solving it in Java.
AssertJ Exception Assertions
Filed under Testing
Learn how to use AssertJ for performing assertions on exceptions.
Introduction to ActiveJDBC
Filed under Persistence
Let’s have a look at ActiveJDBC, a lightweight ORM with a different approach to other popular Java implementations.
Life Cycle of a Thread in Java
Filed under Java Concurrency
Learn about the life cycle of a thread in Java.
Java Weekly, Issue 216
Filed under Weekly Review
This week, Spring Cloud Contract in practice, Java 9 and Reactive Streams and a comprehensive article about traffic shadowing.
Introduction to Smooks
Filed under Data
Learn how Smooks can help you with common data transformations.
Check if a String Is a Palindrome in Java
Filed under Java String
Take a look at different ways to check if a String is a palindrome in Java.
Introduction to ActiveWeb
Discover Activeweb – a full stack web framework from JavaLite.
Introduction to Jinq with Spring
Filed under Spring Persistence
Learn how to use the Jinq database query library for Java 8 in a Spring application.
Priority-based Job Scheduling in Java
Filed under Java Concurrency
A quick and practical example of a priority-based job scheduling in Java.
Asynchronous HTTP with async-http-client in Java
Filed under HTTP Client-Side
A quick and practical guide to AsyncHttpClient in Java.
Exploring the New HTTP Client in Java
Filed under HTTP Client-Side
Explore the new Java HttpClient API which provides a lot of flexibility and powerful features.
Java Weekly, Issue 215
Filed under Weekly Review
A strong week, lots of forward-looking articles about where Java is going, and the very first sponsor I accepted in the Java Weekly after almost 4 years of publishing 🙂
wait and notify() Methods in Java
Filed under Java Concurrency
Learn how to use wait() and notify() to solve synchronization problems in Java.
A Simple Tagging Implementation with Elasticsearch
Learn how you can extend your Elasticsearch project with a tagging implementation
Programmatic Transactions in the Spring TestContext Framework
Filed under Spring Persistence, Testing
A quick and practical guide to transaction management in Spring TestContext.
Java Weekly, Issue 214
Filed under Weekly Review
This week, next-generation OAuth 2.0 support in Spring, JPA 2.2. updates, and an interesting write-up about software developers as craftmanships.
Using a Spring Cloud App Starter
Filed under Spring Cloud
Let’s have a look at how to use Spring Cloud App starters using an example which streams Twitter posts into a Hadoop Distributed File System.
Introduction to Guava Memoizer
Filed under Java
Learn how to memoize results of method calls using Google Guava’s Memoizer.
Changing Tomcat HTTP Port to 80
Filed under DevOps
Learn how to configure an Apache Tomcat HTTP server to run on port 80.
Reactive WebSockets with Spring 5
Filed under Reactive, Spring Web
A quick and practical example of Spring Framework 5 Reactive WebSockets API.
Get Log Output in JSON
Learn how output JSON using the two most popular logging libraries, Jog4j2 and Logback.
Introduction to Javadoc
Filed under Core Java
Learn the basic usage of JavaDoc and how to generate JavaDoc HTML file.
Geospatial Support in ElasticSearch
Filed under NoSQL
Learn how to save geo-data in Elasticsearch and query it using geo queries.
Introduction to Spliterator in Java
Filed under Java Streams
Learn about the Spliterator interface that can be used for traversing and partitioning sequences.
How to Manually Authenticate User with Spring Security
Filed under Spring Security
Learn how to programmatically set the authenticated user in Spring Security and Spring MVC.
Java Weekly, Issue 213
Filed under Weekly Review
This week, implementing Post/Redirect/Get pattern in Servlet API, migration from Dropwizard Metrics to Micrometer, and some cool insights in how code analysis in IntelliJ IDEA works.
A Guide to the finalize Method in Java
Filed under Core Java
Learn about Java’s finalize method and why not to use it.
An Introduction to Kong
Filed under DevOps
A quick and practical introduction to Kong.
An Example of Load Balancing with Zuul and Eureka
Filed under DevOps, Spring Cloud
See how load-balancing with Netflix Zuul looks like.
Spring 5 and Servlet 4 – The PushBuilder
Filed under Jakarta EE, Spring MVC
Learn how to use the PushBuilder in Spring MVC to take advantage of the HTTP/2 server push technology.
Spring Security – Auto Login User After Registration
Filed under Spring Security
Learn how to quickly auto-authenticate a user after they complete the registration process.
Getting Started with Java RMI
Filed under Java
Learn how to communicate between JVMs using Java RMI.
Exceptions in Netty
Filed under DevOps
A quick guide to exception handling in Netty.
A Guide to JavaLite – Building a RESTful CRUD application
Filed under REST
Learn about a JavaLite framework to simplify common tasks that every developer has to deal with when building applications.
Introduction to Spring Method Security
Filed under Spring Security
A guide to method-level security using the Spring Security framework.
Java Weekly, Issue 212
Filed under Weekly Review
This week no common theme – an interesting dive into monitoring reactive applications, Kotlin DSLs, and a comprehensive explanation why Microservices aren’t the universal solution.
Writing a Jenkins Plugin
Filed under DevOps
Learn how to create from scratch a Jenkins plugin.
Integration Guide for Spring and EJB
Filed under Jakarta EE, Spring
Learn how to integrate Enterprise Java Beans into a Spring application.
A Quick Guide to Maven Wrapper
Filed under Maven
Learn how to set up and use Maven Wrapper in a Maven project.
Spring Cloud AWS – Messaging Support
Filed under Spring Cloud
A quick intro to the Spring Cloud support for AWS Messaging.
Spring Cloud AWS – RDS
Filed under Spring Cloud
A quick intro to the Spring Cloud support for AWS RDS.
Spring Cloud AWS – EC2
Filed under Spring Cloud
A quick intro to the Spring Cloud support for AWS EC2.
Spring Cloud AWS – S3
Filed under Spring Cloud
A quick intro to the Spring Cloud support for AWS S3.
Java Weekly, Issue 211
Filed under Weekly Review
This week, some Hibernate tips, new Java Champions announced, and a cool write-up about transitioning from a generalist to a specialist.
Introduction to Java Primitives
Filed under Core Java
Learn the basics of Java’s primitive data types.
Weak References in Java
Filed under JVM
Learn about Weak References in Java and their common usage scenarios
Phantom References in Java
Filed under JVM
Learn about Phantom References in Java and their common usage scenarios.
A Guide to Iterator in Java
Filed under Java Collections
A quick and practical guide to the Iterator class in Java.
Introduction to Future in Vavr
Filed under Java Concurrency
Learn about Vavr’s Future API as an alternative to the Java Future API.
Introduction to VRaptor in Java
Filed under REST
A quick and practical guide to the VRaptor MVC framework for Java.
Regex for Matching Date Pattern in Java
Filed under Java Dates
Learn how to build a RegEx pattern for matching dates from the Gregorian calendar.
How to Find the Kth Largest Element in Java
Filed under Algorithms
Learn several approaches for finding the kth largest element in a set of unique numbers using Java.
Guide to CockroachDB in Java
Filed under Persistence
Learn how to configure, monitor, and interact with an instance of CockroachDB using JDBC.
Java TreeMap vs HashMap
Filed under Java Map
Learn about the differences and similarities between TreeMap and HashMap.
Java 8 StringJoiner
Filed under Java String
A quick and practical guide to the StringJoiner in Java.
A Guide to Multitenancy in Hibernate 6
Filed under Persistence
Learn two approaches for implementing multitenancy using Hibernate 5.
Guide to ThreadLocalRandom in Java
Filed under Java Concurrency
Learn to generate random values in a multi-threaded environment using ThreadLocalRandom.
Java Weekly, Issue 210
Filed under Weekly Review
This week, a quick installment with some interesting guides on Microservices, Ethereum, and some Hibernate basics.
Spring Data Java 8 Support
Filed under Spring Data
A quick and practical guide to Java 8 support in Spring Data.
A Guide to TreeSet in Java
Filed under Java Collections
A quick and practical introduction to the TreeSet in Java.
Soft References in Java
Filed under JVM
Learn about soft references in Java and how they can be used.
Hibernate Interceptors
Filed under Persistence
A quick and practical guide to creating Hibernate interceptors.
Creating a Fat Jar in Gradle
Filed under Gradle
Find out how to build a fat jar using Gradle.
Using InfluxDB with Java
Filed under Persistence
Learn how to use an InfluxDB – a high-performance store for time-series data.
Introduction to KafkaStreams in Java
A quick guide to building streaming applications using KafkaStreams.
Java Weekly, Issue 209
Filed under Weekly Review
No common theme this week: core Java, JUnit, and an interesting reminder why we shouldn’t grant users more privileges than needed.
Quick Guide to BDDMockito
Filed under Testing
A quick guide to using BDDMockito’s fluent API.
Static and Default Methods in Interfaces in Java
Filed under Core Java
Learn how to write and use static and default methods in Java interfaces.
Guide to JSpec
Filed under Testing
Learn to write tests in Java by asserting specifications using the JSpec framework.
Fail-Safe Iterator vs Fail-Fast Iterator
Filed under Java Collections
A quick and practical comparison between fail-safe and fail-fast iterators in Java.
ExecutorService – Waiting for Threads to Finish
Filed under Java Concurrency
Learn how to use ExecutorService in various scenarios to wait for threads to finish their execution.
A Guide to Creating Objects in Java
Filed under Core Java
Take a look at the different ways to initialize primitives and objects in Java.
Configure Jenkins to Run and Show JMeter Tests
Learn how to set up a simple continuous delivery environment to run and show Apache JMeter tests in Jenkins.
Guide to the Cipher Class
Filed under Core Java
Learn how to use the Cipher class to perform cryptographic data encryption and decryption in Java.
Intro to Performance Testing using JMeter
Learn to use Apache JMeter to configure and run performance tests.
Java 9 Variable Handles Demystified
Filed under Java
Explore variable handles in Java 9 through the VarHandle API.
How to Reverse an Array in Java
Filed under Java Array
Learn several approaches to inverting arrays in Java.
A Simple File Search with Lucene
A quick and practical guide to using Apache Lucene for a simple file search.
Recursion in Java
Filed under Core Java
Learn the fundamental concepts of recursion in Java with examples.
Primitive Type Streams in Java 8
Filed under Java Streams
A quick and practical guide to using Java 8 Streams with primitive types.
Java Weekly, Issue 208
Filed under Weekly Review
This week Java 9 with Maven, some interesting Java performance tips and a cool write-up about side-jobs for developers.
Check if a Java Array Contains a Value
Filed under Java Array
Take a look at different ways to search an array for a value.
A Guide to EclipseLink with Spring
Filed under Spring Persistence
Learn how to use Spring Data JPA with EclipseLink as the persistence provider.
Efficient Word Frequency Calculator in Java
Filed under Algorithms
Explore various ways of counting words in Java and see how they perform.
Batch Processing in JDBC
Filed under Persistence
Learn how to execute SQL queries using the batching features of JDBC.
Polymorphism in Java
Filed under Core Java
Discover polymorphism in Java.
Introduction to Apache Lucene
Let’s have a look at Apache Lucene, a full-text search engine which can be used from various programming languages.
Creating a Custom Logback Appender
Filed under Logging
Learn how to implement a custom Logback appender.
A Guide to Inner Interfaces in Java
Filed under Core Java
A quick and practical guide to inner interfaces in Java.
Introduction to Dubbo
Filed under Data
A quick and practical guide to Dubbo framework.
Java Weekly, Issue 207
Filed under Weekly Review
This week, a lot of Java 9, reports from SpringOne, and a cool comparison of Cloud Foundry and Kubernetes.
Spring and Apache FileUpload
Filed under Spring MVC
A quick and practical guide to using Apache FileUpload with Spring.
Introduction to Hibernate Spatial
Filed under Persistence
A quick and practical introduction to Hibernate Spatial
Send Operating System Data into Elastic Stack (ELK Stack)
Learn how to send OS-level data into Elasticsearch (the Elastic Stack).
A Guide to HashSet in Java
Filed under Java Collections
A quick but comprehensive introduction to HashSet in Java.
Getting Started With Mule ESB
Filed under Data
Learn the basics of Mule ESB – a lightweight Java-based Enterprise Service Bus.
Java Weekly, Issue 206
Filed under Weekly Review
This week, some Kotlin, some Java 9, and a lengthy musing about conference speaking.
Introduction to Spring Security ACL
Filed under Spring Security
A quick and practical introduction to Spring Security ACL.
A Quick Guide to Spring Cloud Consul
Filed under Spring Cloud
Learn about the Spring Cloud Consul project which provides easy integration with Consul for Spring Boot applications.
Varargs in Java
Filed under Core Java
A quick and practical introduction to varargs in Java.
Creating a MS PowerPoint Presentation in Java
Filed under Java
Quick and practical example of creating PowerPoint presentations using Java and Apache POI.
A Guide to Java Loops
Filed under Core Java
A quick and practical guide to Java loops.
Writing Custom Gradle Plugins
Filed under Gradle
A quick and practical example of writing a custom Gradle plugin.
Nested Classes in Java
Filed under Core Java
A quick and to-the-point introduction to nested classes in Java.
Comparator and Comparable in Java
Filed under Core Java
A quick and practical guide to Comparable and Comparator interfaces.
Java Weekly, Issue 205
Filed under Weekly Review
Surprisingly, not much Java 9 but JUnit 5, a cool writeup about monads, and some good musings about software developer’s career.
Introduction to the JSON Binding API (JSR 367) in Java
Filed under Jakarta EE, JSON
A quick and practical introduction to the new JSON Binding API in Java.
Convert Date to LocalDate or LocalDateTime and Back
Filed under Java Dates
Learn about possible ways of converting the between old java.util.Date classes and new java.time API.
Implementing the Template Method Pattern in Java
Filed under Architecture
Learn how to leverage the template method pattern in Java.
Introduction to the Java ArrayDeque
Filed under Java Collections
A quick and practical introduction to ArrayDeque in Java.
Introduction to OSGi
Filed under Architecture
A quick and practical introduction to OSGi – a Java-based component system.
Java – Append Data to a File
Filed under Java IO
A quick and practical guide to appending data to files.
Hibernate Inheritance Mapping
Filed under Persistence
A practical guide to understanding different inheritance mapping strategies with JPA / Hibernate.
Mock Final Classes and Methods with Mockito
Filed under Testing
Learn how to mock final classes and methods with Mockito.
How to Kill a Java Thread
Filed under Java Concurrency
Learn how to properly stop a Thread in Java.
Quick Guide on Loading Initial Data with Spring Boot
Filed under Spring Boot, Spring Persistence
A quick and practical example of using data.sql and schema.sql files in Spring Boot.
CAS SSO With Spring Security
Filed under Spring Security
Learn how to integrate the Central Authentication Service (CAS) with Spring Security.
Send the Logs of a Java App to the Elastic Stack (ELK)
A quick, step-by-step look at how to set up logging in a Java application to go into an Elastic Stack instance (formerly known as ELK).
Introduction to Gradle
Filed under Gradle
Discover core concepts of one of the most popular build tools – Gradle.
How to Copy a File with Java
Filed under Java IO
Take a look at some common ways of copying files in Java.
Java Weekly, Issue 204
Filed under Weekly Review
This week a lot of excitement about Java 10, Kotlin, and Hibernate.
Display All Time Zones With GMT and UTC in Java
Filed under Java Dates
Take a look at displaying all time zones with GMT and UTC offsets.
Introduction to Creational Design Patterns
Filed under Architecture
An introduction to four fundamental creational design patterns: Singleton, Factory Method, Abstract Factory, and Builder.
A Guide to Spring AbstractRoutingDatasource
Filed under Spring Persistence
Learn how to use the Spring AbstractRoutingDataSource to dynamically determine the actual DataSource based on the current context.
Guide to Java String Pool
Filed under Java String
Learn how the JVM optimizes the amount of memory allocated to String storage in the Java String Pool.
Spring Security 5 for Reactive Applications
Filed under Reactive, Spring Security, Spring Web
A quick and practical example of Spring Security 5 framework’s features for securing reactive applications.
A Guide to Google-Http-Client
Filed under HTTP Client-Side
Take a look at the Google HTTP Client library for accessing resources via the HTTP connection protocol in Java.
Introduction to Spring Cloud Stream
Filed under Spring Cloud
Learn how to create message-driven and event-driven microservices using Spring Cloud Stream and RabbitMQ.
An Example of Backward Chaining in Drools
Filed under Java IO
Learn what Backward Chaining is and how to use it in practice, with Drools.
Apache Maven Standard Directory Layout
Filed under Maven
A quick introduction to the standard directories and files found in a typical Maven project.
Lazy Verification with Mockito 2
Filed under Testing
Learn how to use the Lazy Verification feature of Mockito 2 in practical examples.
The Java continue and break Keywords
Filed under Core Java
Learn about the continue and break Java keywords and how to use them in practice.
Java Weekly, Issue 203
Filed under Weekly Review
This week Kotlin, a lot of Hibernate and videos from KotlinConf and Devoxx.
REST API Testing with Karate
Learn how to test your REST API with Karate, a BDD-inspired testing framework for Java.
JMX Data to the Elastic Stack (ELK)
Learn how to get the JMX data from a Tomcat server into Elasticsearch and visualized in Kibana.
Introduction to Spring REST Shell
Learn how to use Spring REST Shell, a command-line tool built to facilitate working with HATEOAS-compliant REST APIs.
Web and Application Servers for Java
Filed under DevOps, Jakarta EE
A quick list of the available web and application servers in Java.
Creating a Java Compiler Plugin
Filed under Java
Find out how you can create a Java Compiler plugin.
Generating Prime Numbers in Java
Filed under Java Numbers
See various ways of generating prime numbers in Java.
An Overview of Identifiers in Hibernate/JPA
Filed under JPA
Learn how to map entity identifiers with Hibernate.
Java String.valueOf()
Filed under Java String
A quick example and explanation of the valueOf API of the standard String class in Java.
Java String.trim()
Filed under Java String
A quick example and explanation of the trim API of the standard String class in Java.
Java String.toUpperCase()
Filed under Java String
A quick example and explanation of the toUpperCase API of the standard String class in Java.
Java String.toLowerCase()
Filed under Java String
A quick example and explanation of the toLowerCase() API of the standard String class in Java.
Java String.substring()
Filed under Java String
A quick example and explanation of the substring() API of the standard String class in Java.
Java String.subSequence()
Filed under Java String
A quick example and explanation of the subSequence() API of the standard String class in Java.
Java String.startsWith()
Filed under Java String
A quick example and explanation of the startsWith() API of the standard String class in Java.
Java String.split()
Filed under Java String
A quick example and explanation of the split() API of the standard String class in Java.
Java String.replaceAll()
Filed under Java String
A quick example and explanation of the replaceAll() API of the standard String class in Java.
Java String.replace()
Filed under Java String
A quick example and explanation of the replace() API of the standard String class in Java.
Java String.regionMatches()
Filed under Java String
A quick example and explanation of the regionMatches() API of the standard String class in Java.
Java String.lastIndexOf()
Filed under Java String
A quick example and explanation of the lastIndexOf() API of the standard String class in Java.
Java String.isEmpty()
Filed under Java String
A quick example and explanation of the isEmpty API of the standard String class in Java.
Java String.intern()
Filed under Java String
A quick example and explanation of the intern API of the standard String class in Java.
Java String.indexOf()
Filed under Java String
A quick example and explanation of the indexOf API of the standard String class in Java.
Java String.getBytes()
Filed under Java String
A quick example and explanation of the getBytes API of the standard String class in Java.
Java String.format()
Filed under Java String
A quick example and explanation of the format API of the standard String class in Java.
Java String.endsWith()
Filed under Java String
A quick example and explanation of the endsWith API of the standard String class in Java.
Java String.copyValueOf()
Filed under Java String
A quick example and explanation of the copyValueOf API of the standard String class in Java.
Java String.contains()
Filed under Java String
A quick example and explanation of the contains API of the standard String class in Java.
Java String.concat()
Filed under Java String
A quick example and explanation of the concat API of the standard String class in Java.
Java String.codePointCount()
Filed under Java String
A quick example and explanation of the codePointCount API of the standard String class in Java.
Java String.String()
Filed under Java String
A quick example and explanation of constructors of the standard String class in Java.
Java Weekly, Issue 202
Filed under Weekly Review
We’re starting to talk about Java 10, Spring Boot 2 is almost here, and Hibernate is just as popular. An interesting week in the Java ecosystem.
XML-Based Injection in Spring
Filed under Spring
Learn how to perform an XML-based injection with Spring.
Mocking of Private Methods Using PowerMock
Filed under Testing
Learn how PowerMock can be used to extend the capability of Mockito for mocking and verification of private methods in the class under test.
Groovy Bean Definitions
Learn how we can use a Groovy-based configuration in our Java Spring projects.
Implementing a Runnable vs Extending a Thread
Filed under Java Concurrency
Learn why implementing Runnable is a better approach than extending Thread class.
Guide to Spring Type Conversions
Filed under Spring
Take a look at built-in type converters in Spring and how to add custom ones.
Introduction to Spring AOP
Filed under Spring
Discover the core Spring AOP along with its basic terminology.
A Guide to Spring Boot Admin
Filed under Spring Boot
Learn how to monitor and manage the Spring Boot applications using Spring Boot Admin.
Hibernate – Mapping Date and Time
Filed under Java Dates, JPA
Discover how to map Date/Time properly using Hibernate.
Activiti with Spring Security
Filed under Spring Security
Learn how to integrate Activiti’s identity management with Spring Security.
Making Tomcat UTF-8-Ready
Filed under DevOps
Discover how to make Tomcat UTF-8-Ready.
HibernateException: No Hibernate Session Bound to Thread in Hibernate 3
Filed under Persistence, Spring
Discover when “No Hibernate Session Bound to Thread” exception gets thrown and how to deal with it.
Java Weekly, Issue 201
Filed under Weekly Review
This week – among others – more Java 9, upcoming Java features, and benchmarking Bean Validation implementations.
Java String.charAt()
Filed under Java String
A quick example and explanation of the charAt API of the standard String class in Java.
Java String.codePointAt()
Filed under Java String
A quick example and explanation of the codePointAt API of the standard String class in Java.
Daemon Threads in Java
Filed under Java Concurrency
Discover daemon threads in Java.
Challenges in Java 8
Filed under Java
The other side of the coin of Java 8.
Dynamic Mapping with Hibernate
Filed under Persistence
Explore dynamic mapping capabilities of Hibernate with the @Formula, @Where, @Filter and @Any annotations.
Intro to JDO Queries
Filed under Persistence
Learn about different query languages that JDO supports.
Mockito and JUnit 5 – Using ExtendWith
Filed under Testing
Learn how to automatically inject mocks into Mockito tests using the JUnit 5 extension model.
Mocking Void Methods with Mockito
Filed under Testing
See how to mock methods that return void using Mockito.
Introduction to Apache Spark
Filed under DevOps
Discover Apache Spark – the open-source cluster-computing framework.
Introduction to BouncyCastle with Java
Filed under Security
Discover BouncyCastle – a Java library complementing the default Java Cryptographic Extension (JCE).
Initializing Arrays in Java
Filed under Java Array
Discover different ways of initializing arrays in Java.
Spring Data JPA – Adding a Method in All Repositories
Filed under Spring Data
A practical guide to adding custom methods to all repositories in Spring Data JPA.
Quick Guide to Micrometer
Learn about the metrics facade Micrometer and its integration with Spring.
A Guide to the Static Keyword in Java
Filed under Core Java
Learn about Java static fields, static methods, static blocks and static inner classes.
Java Weekly, Issue 200
Filed under Weekly Review
Unsurprisingly, a lot of Java 9 this week, a JMH introduction, Spring Cloud, and a bit of Hibernate. Oh, and we’re at issue 200 🙂
Mapping Nested Values with Jackson
Learn three ways to deserialize nested JSON values in Java using the Jackson library.
Mathematical and Aggregate Operators in RxJava
Filed under Reactive
A quick guide to mathematical and aggregate operators from the RxJava library
A Guide to Java Bytecode Manipulation with ASM
Filed under Java
Learn how to modify an existing Java class by manipulating its bytecode using the ASM framework.
Spring MVC Guides
Filed under Series, Spring MVC
A comprehensive guide to Spring MVC, and using it to develop web applications.
Commits and NRT Search in SolrCloud
Filed under Cloud
Discover NRT search in the new SolrCloud.
Java Weekly, Issue 199
Filed under Weekly Review
This week was focused on migration guides (Java 9, Microservices). Also, some interesting presentations on RxJava and the blockchain technology.
Bubble Sort in Java
Filed under Algorithms, Java
Learn how Bubble Sort algorithm works, and how to implement it in Java.
Activiti Kickstart App and Activiti Rest Webapp
Filed under Java
Learn how Activiti’s two apps, activiti-app and activiti-rest, can help you manage your processes more easily
Ant vs Maven vs Gradle
See a comparison of three most popular build tools for Java projects.
Model, ModelMap, and ModelAndView in Spring MVC
Filed under Spring MVC
Learn about the interfaces Model, ModelMap and ModelAndView provided by Spring MVC.
Introduction to Caffeine
Filed under Java
Learn how to use the high-performing Caffeine caching library for Java.
Advanced Querying in Apache Cayenne
Filed under Persistence
Learn how to write simple and advanced queries using Apache Cayenne.
Introduction to StreamEx
Filed under Java Streams
An introductory guide to the usage of the StreamEx library in Java.
A Guide to Java Profilers
Filed under DevOps
A quick overview of four popular Java profilers and how they can help you find areas in your code that could benefit from optimization.
Java Weekly, Issue 198
Filed under Weekly Review
Java 9 is out in the wild, JUnit 5 is going strong and builds need to be as immutable as possible. A good week overall.
ProcessEngine Configuration in Activiti
Filed under Java
Learn about various ways of obtaining ProcessEngine and how to set up a database with Activiti.
Exploring the New Spring Cloud Gateway
Filed under Spring Cloud
Learn about the main features of the Spring Cloud Gateway project.
JIRA REST API Integration
Filed under REST
Learn how to integrate with the JIRA Rest API to perform basic JIRA operations.
Comparing Spring AOP and AspectJ
Filed under Spring
See advantages and disadvantages of Spring AOP and AspectJ.
Introduction to ORMLite
Filed under Persistence
A quick and practical introduction to ORMLite in Java.
Introduction To Docx4J
Filed under Data
See how to create docx documents using docx4j in Java.
A Guide to Deeplearning4j
Filed under Artificial Intelligence
See how to create a simple neural network using deeplearning4j library in Java.
Introduction to Conflict-Free Replicated Data Types
A quick, practical guide to conflict-free replicated data types and associated strategies for merging divergent data when recovering from a network partition.
Static Code Analysis in Java
Filed under Java
Static Code Analysis is a method of analyzing the source code of programs without running them.
Mocking Exception Throwing using Mockito
Filed under Testing
Learn to configure a method call to throw an exception in Mockito.
Java Weekly, Issue 197
Filed under Weekly Review
Naturally, a lot of Java-9-related write-ups, Spring 5 is finally out, and a cool article about heritage being a justification for weirdest technical decisions.
Introduction to Atomix
Introduction to Atomix – an embeddable library helping in achieving fault-tolerance and consistency for distributed resources.
Custom JUnit 4 Test Runners
Filed under Testing
Learn how to implement custom JUnit4 test runners.
Validating Container Elements with Jakarta Bean Validation 3.0
Filed under Jakarta EE
See how to use a new Bean Validation 2.0 feature – container elements validation.
Introduction to JGraphT
Filed under Algorithms
Learn how to use JGraphT to create graphs and explore the variety of graph algorithms.
Introduction to Animal Sniffer Maven Plugin
A quick and practical introduction to the Animal Sniffer Maven plugin
Apache Commons Collections Bag
Filed under Java Collections
A quick and practical guide to the Bag collection from Apache Commons.
Java Weekly, Issue 196
Filed under Weekly Review
This week, naturally, some Java 9 but also an interesting Java performance analysis, new security protocol, and a new Hibernate-related open-source project.
Introduction to Apache Cayenne ORM
Filed under Persistence
Learn how to interact with a MySQL database using Apache Cayenne ORM.
Schedulers in RxJava
Filed under Reactive
Discover different types of RxJava schedulers.
Querying Couchbase with N1QL
Filed under NoSQL
Learn about querying a Couchbase Server with N1QL – the SQL equivalent for NoSQL databases.
RxJava Tutorial
RxJava is a Reactive Extensions implementation for Java environment.
Introduction to rxjava-jdbc
Filed under Persistence
Discover how to leverage the power of RxJava in the JDBC context.
Granted Authority Versus Role in Spring Security
Filed under Spring Security
A quick guide to the difference between a granted authority and a role in Spring Security.
Collection Factory Methods for Vavr
Filed under Java
A quick and practical guide to the factory methods for creating Vavr collections in Java using Scala-like syntax.
Proxy, Decorator, Adapter and Bridge Patterns
Filed under Architecture
Learn about the Structural Design Patterns concept by discovering the differences between the Proxy, Decorator, Adapter and Bridge Patterns.
Introduction to Jukito
Filed under Testing
Discover how to test multiple implementations using the same set of test cases with Jukito.
Guide to LinkRest
Filed under REST
Discover LinkRest – an open-source framework for building data-driven REST web services
Java Weekly, Issue 195
Filed under Weekly Review
This week was focused on the Java 9 release and multiple Spring ecosystem updates.
Observable Utility Operators in RxJava
Filed under Reactive
Learn how to use various RxJava utility operators.
Introduction to EthereumJ
Filed under Java
Learn about the EthereumJ library that allows us to interact with the Ethereum blockchain, using Java.
Introduction to GeoTools
Filed under Java
A quick and practical guide to working with geospatial data in Java using the GeoTools open source library.
Guide to the Diamond Operator in Java
Filed under Core Java
A quick and practical guide to the diamond operator that was introduced in Java 7.
Vavr Tutorial
Filed under Series
Vavr is a functional library for Java 8+ that provides immutable data types and functional control structures.
“Stream has already been operated upon or closed” Exception in Java
Filed under Java Streams
Discover how to solve the “Stream has already been operated upon or closed” exception in Java.
Binary Search Algorithm in Java
Filed under Algorithms, Java
Learn how and when to use the Binary Search algorithm.
Guide to Mustache with Spring Boot
Filed under Spring Boot, Spring MVC
Learn how to integrate Mustache templates with Spring Boot.
Introduction to EGit
Filed under IDE
Discover the EGit tool for Eclipse.
Java Weekly, Issue 194
Filed under Weekly Review
A solid week, starting with writing the first test cases using JUnit 5, RxJava tips, multiple Java EE updates, and an interesting guide to NoSQL.
Using Pairs in Java
Filed under Java
Learn how to achieve Pair functionality in Java.
Apache Commons IO
Filed under Java IO
A quick and practical guide to the Apache Commons IO open source library for Java covering many of its better-known features.
RxJava and Error Handling
Filed under Reactive
See how to deal with errors using RxJava.
Compact Strings in Java 9
Filed under Java String
Discover Compact Strings – a new Java 9 feature.
Spring’s RequestBody and ResponseBody Annotations
Filed under REST, Spring MVC
Learn about the Spring @RequestBody and @ResponseBody annotations.
Generate Spring Boot REST Client with Swagger
Filed under REST, Spring Boot
Learn how you can generate a Spring Boot REST client using Swagger Code generator.
Introduction to Retrofit
Filed under HTTP Client-Side
Discover Retrofit – a type-safe HTTP client for Android and Java.
Introduction to RxJava
Filed under Reactive
Discover RxJava – a library for composing asynchronous and event-based programs.
Introduction to JCache
Filed under Data
Learn about a standard caching API for Java – JCache.
Number of Digits in an Integer in Java
Filed under Java Numbers
Learn different ways of getting the number of digits in an Integer in Java.
Example of Vertx and RxJava Integration
Filed under Reactive
A quick and practical example of RxJava and Vertx integration.
Introduction to MBassador
Discover MBassador – a high-performance pub-sub event bus.
New in Spring Security OAuth2 – Verify Claims
Filed under Spring Security
Quick practical intro to the new Claim verification support in Spring Security OAuth.
StringBuilder vs StringBuffer in Java
Filed under Java String
An overview of Java’s StringBuilder and StringBuffer, pointing out similarities and differences.
Integrating Retrofit with RxJava
Filed under REST
Learn how to use RxJava features with Retrofit.
Java Weekly, Issue 193
Filed under Weekly Review
Java Weekly, Issue 193
Guide to JDeferred
Filed under Java
A quick and practical guide to the JDeferred library.
Guide to Collections API in Vavr
Filed under Java Collections
Discover Vavr’s powerful persistent collections API.
OutOfMemoryError: GC Overhead Limit Exceeded
Filed under JVM
Learn about the OOM – GC Overhead Limit Exceeded, its causes and ways to solve it.
“Sneaky Throws” in Java
Filed under Java
Learn about sneaky throw concept that allows you to throw any checked exception without defining it explicitly in the method signature.
Delete a Directory Recursively in Java
Filed under Java IO
Learn how to delete a directory recursively in plain Java, and by using external tools.
Introduction to Vavr’s Validation API
Learn about Vavr’s validation API and how to use its most relevant methods.
Spring Yarg Integration
Filed under Spring
A quick and practical example of Spring integration with Yarg.
Introduction to javax.measure
Filed under Java
A quick and very practical intro to the new Java measurement APIs.
Singletons in Java
Filed under Core Java
See how to implement the Singleton Design Pattern in plain Java.
Introduction to EJB JNDI Lookup on WildFly Application Server
Filed under Jakarta EE
Learn how to implement a basic EJB module on WildFly and call an EJB from a remote client via JNDI.
Runnable vs. Callable in Java
Filed under Java Concurrency
Learn the difference between Runnable and Callable interfaces in Java.
Difference Between Two Dates in Java
Filed under Java Dates
Learn how to calculate the difference between dates in Java, using native approach, as well as external libraries.
Introduction to GraphQL
Filed under Web Services
Learn about GraphQL – a query language that provides an easy way of minimizing complexity between client/server as an alternative approach to REST applications.
Java Weekly, Issue 192
Filed under Weekly Review
Java 9 is very close, and so is JUnit 5. A lot of interesting writeups this week in the Java ecosystem.
String Search Algorithms for Large Texts with Java
Filed under Java String
Discover different full-text search algorithms implemented using plain Java.
List of Rules Engines in Java
Filed under Java
In this article, we’ll learn about some of the most popular rule engines for Java.
CharSequence vs. String in Java
Filed under Java String
Learn the differences between CharSequence and String.
Introduction to Apache Shiro
Filed under Security
Discover Apache Shiro, a versatile Java security framework.
Converting a List to String in Java
Filed under Java String
Learn how to convert a List to a String using different techniques.
Java Weekly, Issue 191
Filed under Weekly Review
A full week both with the new launch I’m running, but also some very interesting stuff happening in the Java EE ecosystem.
Custom Login Page for Returning User
Learn how to develop a custom login page for users returning to our application.
Introduction to Reladomo
Filed under Persistence
Learn how to use Reladomo – the ORM tool from Goldman Sachs.
Introduction to Apache Commons CSV
Filed under Java IO
Learn about how to use Apache Commons to read and create CSV files.
DistinctBy in the Java Stream API
Filed under Java Streams
Learn about various approaches to searching for distinct list elements in Java.
Ratpack with Hystrix
Filed under Reactive
See how to integrate Ratpack with Hystrix.
Introduction to Lambda Behave
Filed under Testing
A quick and practical guide to Lambda Behave – a new Java-based testing framework.
Introduction to JBoss Undertow
Filed under DevOps
Discover Undertow – an extremely lightweight and high-performance web server from JBoss.
Guide to Spring Data LDAP
Filed under Spring Data
Learn how to use Spring Data with LDAP.
Guide to the Volatile Keyword in Java
Filed under Java Concurrency
Learn about the Java volatile keyword and its capabilities.
Java Weekly, Issue 190
Filed under Weekly Review
Kotlin and Clojure are picking up steam, Gatling is definitely both cool and useful, and developers understanding the business is, as always, key. A good week.
Spring Boot Dependency Management with a Custom Parent
Filed under Maven, Spring Boot
See how to leverage Spring Boot’s Parent dependency management even when a custom parent is already defined.
Difference Between URL and URI
Filed under Networking
Discover the differences between URI and URL Java classes.
Spring Batch using Partitioner
Filed under Spring
Learn how to implement a job with parallel processing using Spring Batch.
Java 9 java.util.Objects Additions
Filed under Java
Learn about the new utility methods introduced in the java.util.Objects class in Java 9.
Introduction to Eclipse Collections
Filed under Java Collections
Discover the new collections framework from Eclipse.
Introduction to NoException
Filed under Java
Learn about the NoException library that provides concise and handy exception handlers.
Quick Guide to the Spring @Enable Annotations
Filed under Spring
A quick overview of @Enable annotations in Spring and how they can help to configure an application.
Java Weekly, Issue 189
Filed under Weekly Review
This week was focused on the functional paradigm that’s making its way to both the Java and Spring ecosystem.
Introduction to gRPC
Filed under Data
A quick and practical example of using the gRPC library.
Using Spring @Value With Defaults
Filed under Spring
A quick and practical guide to setting default values when using the @Value annotation in Spring.
Quick Guide to RSS with Rome
Filed under Data
A quick and practical guide to reading, publishing, and editing RSS feeds in Java using Rome API.
Introduction to Bootique
Filed under Architecture, REST
See the overview of Bootique – a lightweight framework for building next-generation scalable micro-services.
Securing Jakarta EE with Spring Security
Filed under Jakarta EE, Spring Security
Learn how to secure a Jakarta EE web application with Spring Security.
Collect a Java Stream to an Immutable Collection
Filed under Java Streams
Learn how to collect Java Streams to immutable Collections.
Java Weekly, Issue 188
Filed under Weekly Review
A Spring 5 focused week for sure, but definitely some good writeups beyond the Spring ecosystem.
Guide to hashCode() in Java
Filed under Core Java
Learn how hashCode() works and how to implement it correctly.
Apache Commons Chain
Filed under Java
Learn about Apache Commons Chain library that helps in implementing the Chain of Responsibility pattern.
Implementing Custom Operators in RxJava
Filed under Reactive
Learn how to implement your own RxJava operators.
Introduction to Hoverfly in Java
Filed under Testing
A quick and practical example of using Hoverfly in Java.
Template Engines for Spring
Filed under Spring MVC
Discover Spring-compatible template engines and see simple examples.
Introduction to Neuroph
Filed under Artificial Intelligence
Learn about Neuroph, an open-source library for creating neural networks and utilizing machine learning.
Introduction to Activiti with Spring
Filed under Spring
Learn how to use Activiti workflow and Business Process Management platform with Spring.
Introduction to PCollections
Filed under Java Collections
Learn about PCollections, a Java library providing persistent, immutable collections.
Introduction to MockServer
Filed under Testing
Explore the MockServer – the tool for mocking/stubbing external HTTP APIs.
Introduction to Spring’s StreamUtils
Filed under Spring
Discover Spring’s StreamUtils class.
Introduction To Kryo
Filed under Data
A quick and practical introduction to Kryo – efficient serialization/deserialization framework for Java.
Migrating from Spring to Spring Boot
Filed under Spring Boot
See how to properly migrate from a Spring to Spring Boot.
Spring – Log Incoming Requests
Filed under Logging, Spring MVC
Learn how to log HTTP Request data with Spring.
Guide to Apache Commons CircularFifoQueue
Filed under Java Collections
A quick and practical guide to the CircularFifoQueue data structure from Apache Commons.
Introduction to Jooby
Filed under Java Web
A quick and practical introduction to Jooby – a scalable and fast web framework.
Generating a Book with Asciidoctor
Filed under Java
See how to use AsciiDoctor to generate a book.
Ratpack Integration with Spring Boot
Filed under Spring Boot
A quick and practical introduction to Ratpack Spring Boot integration.
Spring Cloud Bus
Filed under Jakarta EE, Spring Cloud
Learn how to use Spring Cloud Bus for broadcasting configuration changes and automating client updates.
Java Weekly, Issue 187
Filed under Weekly Review
This week was firing on all cylinders when it comes to new releases – the JDK, Spring, Hibernate and a number of other products good shiny new versions out.
A Guide to Activiti with Java
Filed under Java
Learn the basics of using Activiti with Java.
Introduction to Vaadin
Filed under Jakarta EE
Learn how to use Vaadin – a server-side Java framework for creating web user interfaces.
Cucumber Java 8 Support
Filed under Testing
Discover Java8-related features of Cucumber.
Guide to PDFUnit
Filed under Java IO
Learn how to use PDFUnit to test PDFs text, images, bookmarks and much more.
Overview of the java.util.concurrent
Filed under Java Concurrency
Discover the content of the java.util.concurrent package.
AWS S3 with Java
Filed under Cloud
Learn the basics of Amazon Simple Storage Service (S3) Web Service and how to use AWS Java SDK.
Apache Camel with Spring Boot
Filed under Spring Boot
Learn about Apache Camel with Spring Boot.
Java Static Analysis Tools in Eclipse and IntelliJ IDEA
Filed under IDE
Learn how to use PMD and Cobertura – static analysis tools for Java – and how they integrate with Eclipse and IntelliJ IDEA.
A Guide to Byte Buddy
Filed under Java
A quick and practical example of using ByteBuddy – a tool for runtime class creation.
Microbenchmarking with Java
Filed under Java
Learn about JMH, the Java Microbenchmark Harness.
Apache Commons Collections MapUtils
Filed under Java Map
Learn how to use MapUtils to perform common Map operations.
Data Modeling in Cassandra
Filed under NoSQL
A quick and practical guide to designing Cassandra schemas based on query patterns to achieve better performance.
Java Weekly, Issue 186
Filed under Weekly Review
A solid, forward looking week, now that Java 9 is around the corner, but also looking back at some forgotten Java features, such as labels.
Guide to the HyperLogLog Algorithm in Java
Filed under Algorithms, Data
A quick and practical guide to HyperLogLog for estimating the cardinality of large data sets in Java.
Migrating from JUnit 4 to JUnit 5
Filed under Testing
Learn how to migrate from JUnit 4 to the latest JUnit 5 release – with an overview of the differences between the two versions.
Introduction to Awaitility
Filed under Testing
A quick and practical guide to asynchronous systems testing in Java using Awaitility.
Introduction to Chronicle Queue
Filed under Data
A quick and practical guide to using Chronicle Queue.
Vavr Support in Spring Data
Filed under Spring Data
Learn how to use Vavr in Spring Data repositories.
Java Weekly, Issue 185
Filed under Weekly Review
A full week of interesting articles, from upcoming Java 9 features to Hibernate and testing microservices. A good week.
Drools Spring Integration
Filed under Spring
Learn how to integrate Spring with Drools Rule Management System.
A Guide to JUnit 5 Extensions
Filed under Testing
JUnit 5 Extensions can be used to extend the behavior of test classes or methods.
Introduction to Vavr’s Either
Filed under Java
A quick and practical example of using Either from Vavr in Java.
Introduction to Minimax Algorithm with a Java Implementation
Filed under Algorithms
Learn how to implement one of the most popular problem solver for computer board games – the Minimax algorithm.
A Guide to Apache Commons Collections CollectionUtils
Filed under Java Collections
Learn how to perform common operations with collections using CollectionUtils.
Intro to Security and WebSockets
Filed under Spring MVC, Spring Security
A quick and practical tutorial on how to add security to WebSockets in a Spring MVC application.
Spring Remoting with RMI
Filed under Spring
A quick and practical example of Java RMI with Spring.
A Guide to Apache Commons DbUtils
Filed under Persistence
Learn to work with JDBC through Apache Commons DbUtils.
TemporalAdjuster in Java
Filed under Java Dates
A quick and practical example of using TemporalAdjusters from java.time.
Bloom Filter in Java using Guava
Filed under Java Collections
A quick and practical guide to the Bloom filter, a probabilistic data structure, and how to use its implementation in the Guava library.
Zipping Collections in Java
Filed under Java Collections
See how to zip collections in Java using plain Java and external tools.
Apache Commons Collections BidiMap
Filed under Java Map
Learn about the BidiMap from the Apache Commons Collections library.
Quick Guide to the Guava RateLimiter
Filed under Java
A quick and practical introduction to the Guava RateLimiter.
What Is the serialVersionUID?
Filed under Core Java
A quick and practical example of using serialVersionUID in Java.
Consumer Driven Contracts with Pact
Filed under Testing
Learn how to get started with Pact, a library for utilising Consumer Driven Contracts.
Java Weekly, Issue 184
Filed under Weekly Review
Some interesting writeups this week, from deep-dives into the Stream API to the new JPA 2.2, Hibernate and the new Spring Boot Admin dashboard.
Type Erasure in Java Explained
Filed under Core Java
Learn about an important mechanism in the way Java handles generics – type erasure.
Semaphores in Java
Filed under Java Concurrency
Learn how to use Semaphores in Java.
OAuth2 Remember Me with Refresh Token (using the Spring Security OAuth legacy stack)
Filed under Spring Security
Learn how to implement remember-me functionality with an Angular frontend, for an application secured with Spring Security OAuth.
Spring 5 WebClient
Filed under HTTP Client-Side, Spring Web
Discover Spring 5’s WebClient – a new reactive RestTemplate alternative.
Spring Framework Introduction
Get started with the Spring framework with these introductory tutorials.
Apache Commons BeanUtils
Filed under Data
Learn how to use Apache Commons BeanUtils for common bean operations.
BigDecimal and BigInteger in Java
Filed under Java Numbers
Learn about the Java BigDecimal and the BigInteger data-types.
Introduction to Apache Commons Text
Filed under Java String
Learn how to use Apache Commons Text for common String operations.
Java Weekly, Issue 183
Filed under Weekly Review
An interesting Java Weekly, starting with the new Java 9 modularity vote (it passed), through Kotlin and technical debt in a project. A good week overall.
Apache Commons Collections OrderedMap
Filed under Java Map
A quick and practical guide to the OrderedMap interface and implementations from the Apache Commons Collections library.
Introduction to Netflix Servo
Filed under DevOps
See Netflix Servo in action – a metrics tool for Java applications.
Apache Commons Collections SetUtils
Filed under Java Collections
Learn to use the SetUtils API of Apache Commons Collections library.
Exceptions in Lambda Expression Using Vavr
Filed under Java
Learn about various ways to overcome handling of checked exceptions using the functional Java library Vavr.
The HttpMediaTypeNotAcceptableException in Spring MVC
Filed under Spring MVC
Learn how to deal with the HttpMediaTypeNotAcceptableException in Spring.
A Guide To Cron Expressions
Filed under DevOps
Quick guide to the Unix-based utility cron utility.
Introduction to Asciidoctor in Java
Filed under Java IO
Learn how to generate documents using AsciiDoctor.
CyclicBarrier in Java
Filed under Java Concurrency
Learn how to use CyclicBarrier in Java.
A Java Client for a WebSockets API
Filed under Spring
Learn how to use Spring to implement a Java client to consume a WebSockets API.
Spring with Maven BOM
Learn how to use a BOM, Bill of Materials, in your Spring Maven project.
Monte Carlo Tree Search for Tic-Tac-Toe Game in Java
Filed under Algorithms
Learn Monte Carlo Tree Search (MCTS) algorithm and its applications by exploring implementation for Tic-Tac-Toe game in Java.
Iterate Over a Map in Java
Filed under Java Map
Learn different ways of iterating through the entries of a Map in Java.
How to Warm Up the JVM
Filed under JVM
Learn what it means to warm up a JVM and how to do it.
Allow Authentication from Accepted Locations Only with Spring Security
Filed under Spring MVC, Spring Security
Learn how to only allow users to authenticate from accepted locations only with Spring Security.
Java Weekly, Issue 182
Filed under Weekly Review
A solid week, starting with a number of significant Spring milestones, the Servlet 4 spec (finally) and an interesting intro to Gatling.
Spring YAML Configuration
Filed under Spring
Learn how to configure your Spring application using a YAML file.
How to Get a Name of a Method Being Executed?
Filed under Core Java
Learn to how to find out the name of a method being executed.
Vert.x Spring Integration
Filed under Spring
Learn how to integrate Spring and Vert.x in a single application.
Exploring the Spring 5 WebFlux URL Matching
Filed under Spring MVC
Learn about Spring 5’s new URL matchers.
Locality-Sensitive Hashing in Java Using Java-LSH
Filed under Algorithms, Java
A quick and practical guide to applying the Locality-Sensitive Hashing algorithm in Java using the java-lsh library.
Testing with Selenium/WebDriver and the Page Object Pattern
Filed under Testing
Learn how to test a site using Selenium / WebDriver.
Introduction to Quartz
Filed under Data
Learn how to schedule jobs with the Quartz API.
Changing the Order in a Sum Operation Can Produce Different Results?
Filed under Java Numbers
Learn how the computers represent numbers and why changing the sum order returns a different result.
Converting String to Stream of chars
Filed under Java String
Learn how to convert a String to a Stream of single characters.
Introduction to Liquibase Rollback
Filed under Persistence
Learn how to use the rollback feature of a Liquibase framework.
Java Weekly, Issue 181
Filed under Weekly Review
A closer look at Java 9 and an exciting new feature in JUnit 5.
How to Get All Spring-Managed Beans?
Filed under Spring Boot
Learn about different techniques for displaying all Spring-managed beans.
How to Find All Getters Returning Null
Filed under Java
Learn how to find out all null-returning getters using Java 8 and the Introspector class.
Top Spring Framework Interview Questions
Filed under Spring
A quick discussion of common questions about the Spring Framework that might come up during a job interview.
Spring Boot Tutorial – Bootstrap a Simple Application
Filed under Spring Boot
This is how you start understanding Spring Boot.
Example of Hill Climbing Algorithm in Java
Filed under Algorithms
Learn to implement the Hill-Climbing algorithm in Java – the heuristic technique used for finding the optimal results in large solution space.
Java EE Session Beans
Filed under Jakarta EE
Session beans come in two flavors: Stateful and stateless. Learn the difference between the two.
How to Get All Dates Between Two Dates?
Filed under Java Dates
Learn how to get all dates between two dates using Java 7, Java 8, and Java 9.
Testing with JGoTesting
Filed under Testing
A quick and practical guide to testing Java applications with JGoTesting, a JUnit-compatible framework.
Java Web Weekly, Issue 180
Filed under Weekly Review
New immutable collections in Java, a look at caching and CDNs, and a very interesting discussion about microservices and decomposition. Really solid week.
Serenity BDD and Screenplay
Filed under Testing
A quick and practical example of Serenity BDD Framework with Screenplay.
Introduction to Netty
Filed under Java
Learn how to set up a small Netty server and client in Java.
Changing Annotation Parameters at Runtime
Filed under Core Java
Learn how to change annotation parameters in runtime using reflection in Java.
How to Inject a Property Value Into a Class Not Managed by Spring?
Filed under Spring
Learn how to initialize properties values in Java classes without the direct use of Spring’s injection mechanism.
Merging Streams in Java
Filed under Java Streams
Learn the different ways of merging Java Streams.
Guide to Akka Streams
A quick and practical guide to data stream transformations in Java using the Akka Streams library.
How to Round a Number to N Decimal Places in Java
Filed under Java Numbers
Overview of several ways of handling the common problem of rounding a decimal number in Java
Java 9 Reactive Streams
Quick and practical introduction to Reactive Streams in Java 9.
Intro to Structurizr
Filed under Architecture
Learn Structurizr, a diagram editor that renders architectural artifacts using Java.
The Difference Between map() and flatMap()
Filed under Java Streams
Learn about the differences between map() and flatMap() by analyzing some examples of Streams and Optionals.
Java Web Weekly, Issue 179
Filed under Weekly Review
Definitely some interesting writeups this week, all about building microservice architectures, managing an organization well as the CIO, and doing work on legacy code.
Java 9 Optional API Additions
Filed under Core Java
Quick and practical examples of new methods in Optional API in Java.
The Dining Philosophers Problem in Java
Filed under Algorithms, Java Concurrency
Discover the Dining Philosophers Problem and a solution in Java.
Guide to Escaping Characters in Java RegExps
Filed under Core Java
Learn how to escape special characters in Java Regular Expressions.
How to Get the Last Element of a Stream in Java?
Filed under Java Streams
Have a look at ways to get the last element of a Stream in Java.
Guide to Dynamic Tests in Junit 5
Filed under Testing
Learn about dynamic tests introduced in JUnit 5 – a new programming model that supports full test lifecycle.
Guide to UUID in Java
Filed under Core Java
A quick and practical introduction to UUID in Java.
Introduction to Testing with Arquillian
Filed under Testing
Learn how to prepare and execute tests using Arquillian, a container-agnostic integration testing framework.
Introduction to JUnitParams
Filed under Testing
A quick and practical guide to a very useful library which will help you write parameterized unit tests – JUnitParams.
Java Web Weekly, Issue 178
Filed under Weekly Review
A light week with some fantastic writeups, from the No vote for Jigsaw, on to Hibernate with PostgreSQL, to a deep dive into the disadvantages of microservice architecture.
ClassNotFoundException vs NoClassDefFoundError
Filed under Java
Learn about the differences between ClassNotFoundException and NoClassDefFoundError.
Testing with Google Truth
Filed under Testing
A quick and practical guide to the Google Truth testing framework for Java.
Spring Remoting with JMS and ActiveMQ
Filed under Spring
A quick and practical example of remoting with Spring and JMS.
Iterating Over Enum Values in Java
Filed under Core Java
Learn three simple ways to iterate over a Java enum.
Serenity BDD with Spring and JBehave
A quick and practical example of Serenity with Spring and JBehave.
How to Add a Single Element to a Stream
Filed under Java Streams
A quick tutorial describing how to add an element to the beginning, end, or middle of a Java 8 Stream.
Introduction to Mustache
Filed under Jakarta EE
Learn how to use Mustache, a logicless template engine for creating dynamic HTML pages, configuration files, etc.
Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java
Filed under Java IO
A quick review of the differences between three methods for obtaining the filesystem path of a File object in Java.
Guide to Spring Web Flow
Filed under Spring MVC
Learn how to use the Spring Web Flow library, do configuration properly and integrate it with Spring MVC.
Introduction to HikariCP
Filed under Persistence
We learn about the HikariCP JDBC connection pool project.
Software Transactional Memory in Java Using Multiverse
Learn how you can implement STM in your application with the help of Multiverse library.
Java Web Weekly, Issue 177
Filed under Weekly Review
An eventful week after the Jigsaw vote, lots of new stuff on the horizon and of course my releases of the new Certification classes.
Introduction to Drools
Filed under Java IO
Learn how to use Drools as a Business Rule Management System (BRMS).
How to Remove the Last Character of a String?
Filed under Java String
Learn how to remove the last character of a String with core Java or using external libraries.
Guide to Mathematical Utilities in Guava
Filed under Java Numbers
Learn how to use some very useful mathematical operations available in the Guava Library.
Introduction to Java Serialization
Filed under Core Java
We learn how to serialize and deserialize objects in Java.
Split a String in Java
Filed under Java String
The article discusses several alternatives for splitting a String in Java.
Guide to Guava MinMaxPriorityQueue and EvictingQueue
Filed under Java Collections
A quick guide to two interesting queue implementations from Guava library.
The StackOverflowError in Java
Filed under Core Java
Learn how one of Java’s most common errors – StackOverflowError – occurs, and how to resolve it.
Java Double Brace Initialization
Filed under Core Java
Learn how double braces can be used for creating and initializing objects and for representing these operations in a single expression.
Count Occurrences of a Char in a String
Filed under Java String
Learn how to count characters with the core Java library and with libraries and frameworks such as Spring and Guava.
Guide to DelayQueue
Filed under Java Collections
Learn to use Java’s DelayQueue. Useful for concurrent programming, elements may only be removed from queue when their time has expired.
Custom Reporting with TestNG
Filed under Testing
Quick and practical example of custom logging and reports done using TestNG.
Guide to Guava ClassToInstanceMap
Filed under Java Map
Learn how to use the Google Guava’s ClassToInstanceMap interface and its implementations.
Java Web Weekly, Issue 176
Filed under Weekly Review
An eventful week in the Java ecosystem, with the negative vote for Jigsaw and lots of solid writeups about Java 9 and the upcoming Spring 5.
A Guide to @RepeatedTest in JUnit 5
Filed under Testing
Learn different ways of using and configuring the @RepeatedTest annotation provided by JUnit.
JHipster with a Microservice Architecture
Filed under Architecture
Learn how to build a microservices architecture using JHipster.
Guide to the Java Phaser
Filed under Java Concurrency
Learn how Java’s Phaser API can help you deal with advanced thread coordination tasks.
Call Methods at Runtime Using Java Reflection
Filed under Core Java
A quick and practical guide to runtime method invocation using the Java Reflection API.
Guide to Java Data Objects
Filed under Persistence
Learn how to use the Java Data Objects (JDO) – designed for persisting object-oriented data into any database.
Converting a Stack Trace to a String in Java
Filed under Core Java
Learn how to convert a Stack Trace to a String using core Java method or Apache Commons-Lang library.
Period and Duration in Java
Filed under Java Dates
Learn what is the difference between Duration and Period classes in Java.
Guide to CopyOnWriteArrayList
Filed under Java Collections
A quick overview of Java’s CopyOnWriteArrayList and its most common usages.
Introduction to JDBC
Filed under Java, Persistence
A quick and practical introduction to JDBC in Java.
Java Web Weekly, Issue 175
Filed under Weekly Review
An extensive week chock-full of interesting writeups and Java 9 news.
Quick Guide to Spring Roo
Filed under Spring
Learn how to use Spring Roo – a rapid Java applications development tool
Spring Boot and Togglz Aspect
Filed under Spring Boot
A quick and practical example of using Togglz with Spring Boot.
How to Copy an Array in Java
Filed under Java Array
Learn how to copy an array in Java, with examples of various methods.
Dynamic Proxies in Java
Filed under Java
Learn how to use Java’s dynamic proxies – one of the primary proxy mechanisms available in the language.
Using Java MappedByteBuffer
Filed under Java
A short overview of how MappedByteBuffer can be used for high-performance file manipulation.
Java Annotations Interview Questions (+ Answers)
Filed under Java
A set of popular Java annotations interview questions and, of course, answers.
LongAdder and LongAccumulator in Java
Filed under Java
Learn how LongAdder and LongAccumulator can aid you in your multi-threaded applications
Difference Between Wait and Sleep in Java
Filed under Java Concurrency
A quick and practical example of the difference between sleep() and wait() methods in Java.
Do a Simple HTTP Request in Java
Filed under HTTP Client-Side, Java
A quick and practical guide to performing basic HTTP requests using Java’s built-in HttpUrlConnection.
Guide to the ConcurrentSkipListMap
Filed under Java Concurrency, Java Map
A quick introduction to Java’s ConcurrentSkipListMap, with an example of the typical usage
Guide to the Most Important JVM Parameters
Filed under JVM
Learn about the most important JVM parameters which can be used to improve web applications performance.
HashSet and TreeSet Comparison
Filed under Java Collections
A quick review of the similarities and differences between HashSet and TreeSet in Java.
Introduction to Serenity BDD
Filed under Testing
A quick and practical introduction to SerenityBDD and its integrations.
Introduction to JAX-WS
Filed under Jakarta EE
Learn how to create a SOAP web service and consume it using JAX-WS.
An Intro to the Spring DispatcherServlet
Filed under Architecture, Spring MVC
A quick and practical guide to the request processing workflow of Spring’s DispatcherServlet with a focus on the HandlerAdapter interfaces.
Guide to the Java TransferQueue
Filed under Java Collections
Learn how the Java’s TransferQueue can help you in writing multithreaded applications.
Testing in Spring Boot
Filed under Spring Boot, Testing
Learn about how the Spring Boot supports testing, to write unit tests efficiently.
Introduction to the Stripe API for Java
Filed under Spring Boot
A quick and practical guide to charging a credit card using the Stripe API for Java.
An Intro to Spring Cloud Zookeeper
Filed under Spring Cloud
Learn to do Service discovery using Spring and Zookeeper.
Guide to @ConfigurationProperties in Spring Boot
Filed under Spring Boot
A quick and practical guide to @ConfigurationProperties annotation in Spring Boot.
A Guide to Java SynchronousQueue
Filed under Java Collections
Learn how you can utilize Java’s SynchronousQueue to help you coordinate the work of multiple threads.
Create a Custom Auto-Configuration with Spring Boot
Filed under Spring Boot
A quick, practical guide to creating a custom auto-configuration in Spring Boot.
Spring Remoting with AMQP
Filed under Spring
A quick, practical guide explaining how to use Spring Remoting with AMQP to perform synchronous remote procedure calls over an asynchronous medium.
RabbitMQ Message Dispatching with Spring AMQP
Filed under Spring
Explore the concept of fanout and topic exchanges with Spring AMQP and RabbitMQ.
A Quick Guide to Spring @Value
Filed under Spring
Learn to use the Spring @Value annotation to configure fields from property files, system properties, etc.
Introduction to Apache Commons Math
Filed under Java Numbers
Learn about the Apache Commons Math, which is the biggest open-source library of mathematical functions and utilities for Java.
A Guide to Java EE Web-Related Annotations
Filed under Jakarta EE
A quick and practical guide to annotations introduced with Servlet API 3.1 in Java EE 7.
Java Web Weekly, Issue 173
Filed under Weekly Review
An interesting week focused on testing, Java 9 and Spring Boot.
Introduction to Groovy Language
Filed under Groovy
A look some of the essential features of Groovy, including basic syntax, control structures, and collections.
Creating a Custom Starter with Spring Boot
Filed under Spring Boot
A quick and practical guide to creating custom Spring Boot starters.
Quick Guide to MyBatis
Filed under Persistence
Learn about MyBatis, an open source persistence framework which simplifies the implementation of database access.
JVM Garbage Collectors
Filed under JVM
Learn the basics of different JVM Garbage Collection (GC) mechanisms and use cases.
Guide to sun.misc.Unsafe
Filed under Java
Learn how to take advantage of sun.misc.Unsafe‘s interesting methods, which span outside of the usual Java usage
Java Exceptions Interview Questions (+ Answers)
Filed under Java
A set of Java exceptions-related interview questions.
Introduction to Apache Flink with Java
Filed under Data
A practical guide to processing batch and stream data with the Apache Flink API for Java.
JVM Log Forging
Filed under JVM
Learn about JVM log forging and techniques to overcome this security concern.
An Introduction to ThreadLocal in Java
Filed under Java Concurrency
A quick and practical guide to using ThreadLocal for storing thread-specific data in Java.
Java Flow Control Interview Questions (+ Answers)
Filed under Java
A set of Java flow control related interview questions to help you prepare.
Converters, Listeners and Validators in Java EE 7
Filed under Jakarta EE
Learn about converters, listeners, and validators provided by Java EE 7.
Dynamic DTO Validation Config Retrieved from the Database
Filed under Persistence, Spring Boot
A quick, practical guide to creating a custom, dynamic DTO validation annotation that retrieves its configurations from a database.
Using @JsonComponent in Spring Boot
Filed under JSON, Spring Boot
Learn how to use the @JsonComponent annotation in Spring Boot.
Java Web Weekly, Issue 172
Filed under Weekly Review
A rather quick review this week, but definitely full of interesting reads, starting with the impact of Java 9 on some tools to the performance of logging frameworks.
Introduction to Jenetics Library
Filed under Algorithms
A quick, practical guide to using the Jenetics library for Java to find solutions to several well-known optimization problems.
Embedded Jetty Server in Java
Filed under DevOps, Jakarta EE
A quick and practical introduction to the embedded Jetty
REST Query Language – Implementing OR Operation
Learn how to extend the possibilities of your API by implementing the OR query operation
Testing a REST API with JBehave
Filed under Testing
A quick and practical guide to REST testing with JBehave
Quick Guide to the Java StringTokenizer
Filed under Java String
Learn how to use StringTokenizer in Java.
Configuring Separate Spring DataSource for Tests
Filed under Spring Data, Testing
A quick, practical tutorial on how to configure a separate data source for testing in a Spring application.
JasperReports with Spring
Filed under Spring
A quick and practical guide to setting up JasperReports with Spring.
Check If a Number Is Prime in Java
Filed under Java Numbers
Learn how to check the primality of the number using Java.
Cucumber and Scenario Outline
Filed under Testing
Learn how to write Behavioral Driven Development (BDD) unit tests using Cucumber and its concept named Scenario Outline.
Java Web Weekly, Issue 171
Filed under Weekly Review
A Kotlin heavy week, with some interesting testing and QA writeups in the mix. A good week overall.
Intro to JaVers
Filed under Java
JaVers helps programmers in detecting and auditing changes in the states of simple Java objects.
Guide to Reactive Microservices Using Lagom Framework
Filed under Architecture, Reactive
Learn how to write a real application based on microservices using the Lagom framework.
Custom Scope in Spring
Filed under Spring
A quick, practical guide to implementing a custom Scope in Spring.
Custom Information in Spring Boot Info Endpoint
Filed under Spring Boot
Learn how to add custom data to Spring Boot Actuator’s /info endpoint.
Spring MVC Custom Validation
Filed under Spring MVC
Learn how to build a custom validation annotation and use it in Spring MVC.
A Guide to the Spring State Machine Project
Filed under Spring
Learn how to use Spring’s State Machine project, to represent workflows or any other kind of finite state machines for your system.
List of In-Memory Databases
Filed under Persistence
A quick review of how to configure some of the more popular in-memory databases for a Java application.
Create a Custom FailureAnalyzer with Spring Boot
Filed under Spring Boot
A quick, practical guide to using a custom FailureAnalyzer in Spring Boot to provide a more helpful error message when an application startup failure occurs.
Introduction to Vert.x
Filed under REST
Learn how the use Vert.x – the open source, reactive and polyglot software development toolkit.
Ratpack Google Guice Integration
Filed under Reactive
Learn how to use a Java open source software framework, Google Guice, by integrating it with Ratpack.
Implementing a Custom Spring AOP Annotation
Filed under Spring
A quick example of a custom Spring AOP annotation
A CLI with Spring Shell
Filed under Spring
A quick and practical example of building a simple CLI with Spring Shell.
New in Guava 21 common.util.concurrent
Filed under Java Concurrency
A quick reference guide for changes that appeared in common.util.concurrent package.
Map Serialization and Deserialization with Jackson
A quick and practical guide to serializing and deserializing Java Maps using Jackson.
Exploring the Spring Boot TestRestTemplate
Filed under HTTP Client-Side, Spring Boot, Spring Web, Testing
Learn how to use the new TestRestTemplate in Spring Boot to test a simple API.
A Guide to GemFire with Spring Data
Filed under Spring Data
Learn how to use GemFire to efficiently manage distributed data.
Java Web Weekly, Issue 170
Filed under Weekly Review
A quick review this week, with some very interesting writeups, from the deprecation of finalization in Java to a balanced way to look at the modularization of a system.
Guide to Java 8 Comparator.comparing()
Filed under Java
A practical guide to the static functions and instance methods of the Comparable interface that were introduced in Java 8.
Introduction to the Functional Web Framework in Spring 5
Filed under Spring Web
A quick and practical guide to the new Functional Web Framework in Spring 5
A Guide to the Java Web Start
Filed under Java Web
This article explains what Java Web Start (JWS) is, how to configure it on the server side, and how to create a simple application.
Converting Strings to Enums in Java
Filed under Java String
A quick and practical guide to converting strings to enums in Java.
Introduction to TestNG
Filed under Testing
The article introduces the basic concepts of TestNG testing library.
CORS in JAX-RS
Filed under Jakarta EE
Learn how to implement Cross-Origin Resource Sharing (CORS) mechanism in JAX-RS based applications.
Self-Contained Testing Using an In-Memory Database
Filed under Spring Persistence, Testing
A quick, practical tutorial on setting up an in-memory database for running self-contained persistence-layer tests in a Spring application.
Java Generics Interview Questions (+Answers)
Filed under Java
Popular generics-related Java interview questions and of course answers.
Full-text Search with Solr
Filed under Persistence
Learn how to use Solr Search Engine’s capabilities and features, such as building different queries, search faceting, highlighting and suggesting terms.
Using Math.pow in Java
Filed under Java Numbers
Learn how to use the Java’s Math.pow() method to calculate the power of any given base quickly.
HTTP PUT vs HTTP PATCH in a REST API
Filed under REST, Spring MVC
Learn about the difference between PUT and PATCH HTTP methods, and their implications when building your Spring API.
Intro to Apache Kafka with Spring
Filed under Spring
A quick and practical guide to using Apache Kafka with Spring.
Intro to JHipster
Filed under Spring Boot
Learn how to get started with JHipster by creating a first, simple application.
Download an Image or a File with Spring MVC
Filed under Spring MVC
A quick and practical guide to returning an image in a Spring REST endpoint.
Jackson Streaming API
A quick overview of Jackson’s Streaming API for processing JSON, including the examples
Introduction to Project Jigsaw
Filed under Java
Learn how to create, compile and run a simple modular application, using new JDK tools, introduced as a Project Jigsaw.
Introduction to Testing with Spock and Groovy
A quick and practical guide to testing with Spock and Groovy.
Java Web Weekly, Issue 169
Filed under Weekly Review
A diverse week starting with Java 9, through a look at the Open-Closed principle and finishing up with a fantastic review of browser caching.
Introduction to JSONassert
Learn how to use a JSONassert library, focused on understanding JSON data, by writing complex JUnit tests.
New Stream, Comparator and Collector in Guava 21
Filed under Java Streams
Quick and practical guide to tools in the common.collect package in Guava 21.
Form Validation with AngularJS and Spring MVC
Filed under Spring MVC
A quick, practical guide on how to validate form input using AngularJS client-side and Spring MVC server-side validation.
Property Testing Example With Vavr
Filed under Testing
Learn about Property Based Testing, and how Vavr library makes writing them easy.
Spring Boot Authentication Auditing Support
Filed under Spring Boot
Explore the Spring Boot Actuator module and the support for publishing Authentication and Authorization events in conjunction with Spring Security.
Introduction to JiBX
Filed under XML
Learn how to use JiBX to convert XML to Java POJOs and vice versa.
Guide to Internationalization in Spring Boot
Filed under Spring Boot
A quick, practical guide to internationalization in Spring Boot.
Testing an OAuth Secured API with Spring MVC (using the Spring Security OAuth legacy stack)
Filed under Spring MVC, Spring Security, Testing
A quick, practical guide to testing an API secured by OAuth with the Spring MVC test support.
Introduction to Ratpack
Filed under Reactive
Learn how to use Ratpack, a set of JVM based libraries built for modern days high-performance web applications.
Using Custom Banners in Spring Boot
Filed under Spring Boot
Learn how to configure custom start-up banners in Spring Boot applications.
Java Web Weekly, Issue 168
Filed under Weekly Review
This week, we’re focusing on deployment and performance of Java applications.
Introduction to Javassist
Filed under Java
Introduction to Javassist – a bytecode manipulation library, covering its basic features.
Introduction to Javatuples
Filed under Data
Learn how to use javatuples library that provides elegant semantics for working with tuples.
Introduction to Google Protocol Buffer
Filed under Data
Learn the basic concepts of the Google’s Protocol Buffers demonstrated on a simple example.
Overview of Spring Boot Dev Tools
Filed under Spring Boot
A quick and practical overview of the Spring Boot Devtools.
A Guide to the Java API for WebSocket
Filed under Java IO
WebSocket provides an alternative to the limitation of efficient communication between the server and the web browser by providing bi-directional, full-duplex, real-time client/server communications.
Multiple Entry Points in Spring Security
Filed under Spring Security
A quick, practical guide to configuring multiple entry points in Spring Security.
Guide to Google Guice
Filed under Java
A quick, practical guide to dependency injection in Google Guice.
A Guide to Redis with Redisson
Filed under NoSQL
A quick and practical guide to using Redisson for accessing Redis from a Java application.
[NEWS] AssertJ 3.6.X – Interview with Joel Costigliola
A quick interview with the creator of AssertJ – Joel Costigliola – about the recent 3.6 release of the library.
Java 9 CompletableFuture API Improvements
Filed under Java Concurrency
Quick and practical guide to new methods in CompletableFuture API.
Spring LDAP Overview
Filed under Spring
Learn how to use the Spring LDAP APIs to authenticate and search for users, as well as to create and modify users in the directory server.
@Immutable in Hibernate
Filed under Persistence
A quick and practical guide to @Immutable annotation in Hibernate
Introduction to Twitter4J
Filed under Java
Learn how to communicate with the Twitter API from Java using the Twitter4J.
Ant Colony Optimization with a Java Example
Filed under Algorithms
A quick tutorial on the ant colony optimization genetic algorithm in Java.
Concurrent Test Execution in Spring 5
An quick example of concurrent test execution in Spring 5.
Java Money and the Currency API
Filed under Java
A quick guide to the Currency and Money upcoming JSR and how to use it in practice.
Introduction to Java 9 StackWalking API
Filed under Core Java
In this article, we will look at Java 9’s new StackWalking API that provides an access to a Stream of StackFrames.
Java Web Weekly, Issue 167
Filed under Weekly Review
Lots of Spring releases this week, along with some solid Java 9 articles looking at what’s coming (very soon) with that release. A diverse and solid week.
String Processing with Apache Commons Lang 3
Filed under Data, Java String
Quick intro to working with Strings with the Apache Commons library and StringUtils.
Array Processing with Apache Commons Lang 3
Filed under Java Array
Quick intro to working with arrays with the Apache Commons library and ArrayUtils.
Java Primitive Conversions
Filed under Core Java
The most useful conversions of Java primitive types.
HBase with Java
Filed under Persistence
Introduction to HBase database and interaction with it using the Java client.
Intro to Jasypt
Filed under Security
Quick Jasypt library overview, including simple examples and typical usage scenarios.
AngularJS CRUD Application with Spring Data REST
Filed under REST, Spring Data
A quick guide to creating a CRUD application using AngularJS and Spring Data REST.
Mockito’s Java 8 Features
Filed under Testing
Overview of Java 8 support in Mockito framework, including Streams and default interface methods
Guide to Guava’s Reflection Utilities
Filed under Java
Introduction to Guava’s Reflection API, with examples of the most common usages.
Intro To Reactor Core
Filed under Reactive
Introduction to Reactor Core project, covering the basic concepts
How to Register a Servlet in Java
Filed under Jakarta EE, Spring
A practical guide to registering servlets in Jakarta EE and Spring Boot.
Guide To Solr in Java With Apache SolrJ
A quick and practical guide on interacting with an Apache Solr server in Java using the Solr4J library.
Java 9 Process API Improvements
Filed under Core Java
A quick intro to the interesting Java 9 additions to the Process API and how these give us much more control over the running and spawned processes.
Spring Security – Redirect to the Previous URL After Login
Filed under Spring Security
A short example of redirection after login in Spring Security
Java 9 – Exploring the REPL
Filed under Java
Quick intro to jshell, the interactive REPL (Read-Evaluate-Print-Loop) console bundled with JDK 9.
Intro to Log4j2 – Appenders, Layouts and Filters
Filed under Logging
This article, using an example rich approach, introduces Log4J 2 Appender, Layout and Filter concepts
Working with Relationships in Spring Data REST
Filed under REST, Spring Data
A practical guide to working with entity relationships in Spring Data REST.
Introduction to cglib
Filed under Java
Overview of cglib – the popular code generation library, its features and most common use cases
Spring Remoting with Hessian and Burlap
Filed under Spring
A quick, practical guide to implementing RMI in Spring Remoting using Hessian and Burlap.
Guide to java.util.concurrent.Locks
Filed under Java Concurrency
In this article, we explore various implementations of the Lock interface and the newly introduced in Java 9 StampedLock class.
AWS Lambda Using DynamoDB With Java
Introducing AWS Lambda and DynamoDB combination, including configuration steps and demo application.
Introduction to RabbitMQ
Filed under Data
A quick and practical guide to RabbitMQ.
Introduction to Cobertura
A quick and practical guide to generating code coverage reports with Cobertura.
Introduction to jOOL
Filed under Java
Introducing jOOL’s main features, with typical usage examples
Finding Max/Min of a List or Collection
Filed under Java Collections
A quick and practical guide to getting maximum/minimum element from a list or a collection.
Java Web Weekly, Issue 165
Filed under Weekly Review
Upcoming Java 9 goodness, an ElasticSearch handy cheat-sheet and a cool example of evolving a mature framework. Good stuff all round this week.
A Quick Struts 2 Intro
Filed under Jakarta EE
In quick introduction to different core components of the Struts2 framework, with a MVC web application implementation.
Guide to Spring WebUtils and ServletRequestUtils
Filed under Spring MVC
In this article, we explore the build-in web request utils in Spring MVC – WebUtils, ServletRequestUtils.
Upload and Display Excel Files with Spring MVC
Filed under Spring MVC
A quick and practical guide to uploading and displaying Excel files in a Spring MVC application using Apache POI.
Intro to Apache BVal
Filed under Jakarta EE
A quick and practical tutorial on the Apache BVal implementation of the JSR-349 Java Bean Validation specification.
A Quick JUnit vs TestNG Comparison
Filed under Testing
A quick look at JUnit compared to TestNG – the other popular testing framework in the Java ecosystem.
Introduction to Apache Velocity
Filed under Jakarta EE
Learn the main features of Apache Velocity and explore how it can be used to create dynamic web pages in a Java web application.
Guide to Guava’s EventBus
Filed under Data
Use Guava’s EventBus for publish-subscribe communication between components.
A Guide to Neo4J with Java
Filed under Persistence
This article is about Neo4j – one of the most mature and full-featured graph databases on the market today.
Advanced Apache HttpClient Configuration
Filed under HTTP Client-Side
HttpClient configurations for advanced use cases.
Introduction to Guava CacheLoader
Filed under Java
A short introduction to Guava’s CacheLoader and its usage.
String Operations with Java Streams
Filed under Java Streams
Learn how to split a comma-separated String into a list of Strings and how to join a String array into a comma-separated String.
The @ServletComponentScan Annotation in Spring Boot
Filed under Spring Boot, Spring MVC
A quick and practical guide to the new ServletComponentScan annotation.
Spring Security – Customize the 403 Forbidden/Access Denied Page
Filed under Spring Security
A quick and focused tutorial on customizing the 403 Forbidden error response page in a Spring Security application.
Custom Thread Pools in Java 8 Parallel Streams
Filed under Java Concurrency, Java Streams
Brief intro to custom thread pools and their use in Java 8 parallel streams.
Java Web Weekly, Issue 164
Filed under Weekly Review
From signing a Spring Boot jar to a new multi-release jar feature in Java 9 – with a short stop to look at some solid habits developers should work on – a great week.
Using Optional with Jackson
A quick overview of how we can use the Optional with Jackson.
How to Test RxJava?
Filed under Reactive
An intro to the way we can test our RxJava logic.
Java 8 and Infinite Streams
Filed under Java Streams
A short and practical guide to working with infinite streams in Java 8.
Two Login Pages with Spring Security
Filed under Spring Security
A quick and practical guide to configuring Spring Security with two separate login pages.
Design a Genetic Algorithm in Java
Filed under Algorithms
A quick and practical guide to designing a basic genetic algorithm in Java.
Quick Intro to Full-Text Search with ElasticSearch
This article, explores ElasticSearch’s REST API, and performs basic operations using HTTP requests.
Java Web Weekly, Issue 163
Filed under Weekly Review
Quite a full week in the Java ecosystem – starting with a hands-on guide on the upcoming module system, improvements to the new Time APIs and news about MicroProfile.
Strategy Design Pattern in Java 8
Filed under Spring
Implementation of Strategy design pattern in the light of Java 8 features.
Guide to WeakHashMap in Java
Filed under Java Map
Explaining the WeakHashMap, how it works, when to use it, and a small example.
Avoiding the ConcurrentModificationException in Java
Filed under Java Concurrency
A short insight in Java’s ConcurrentModificationException, why it happens and how to avoid it.
Hibernate One to Many Annotation Tutorial
Filed under Persistence
In this tutorial we’ll have a look at the one-to-many mapping using JPA annotations with a practical example.
JAX-RS Client with Jersey
Filed under Jakarta EE, REST
A quick introduction to JAX-RS client using Jersey 2.
Working with Microsoft Excel in Java
Filed under Java IO
A quick tutorial on working with Excel files in Java using Apache POI and JExcel.
Spring Security – Cache Control Headers
Filed under Spring Security
A guide to controlling HTTP cache control headers with Spring Security.
Spring @RequestMapping New Shortcut Annotations
Filed under REST, Spring MVC
In this article, we introduce different types of @RequestMapping shortcuts for quick web development using traditional Spring MVC framework.
Guide to PriorityBlockingQueue in Java
Filed under Java Collections
Introduction to Java’s PriorityBlockingQueue with usage examples
Dealing with Backpressure with RxJava
Filed under Reactive
A guide demonstrating several strategies of handling backpressure in RxJava
Guide to Guava’s PreConditions
Filed under Java
In this tutorial, we’ll show how to use the Google Guava’s Preconditions class.
Working with Apache Thrift
Filed under Data
Introduction to Apache Thrift with instructions on how to build a sample application
Constructor Injection in Spring with Lombok
Filed under Spring
A quick and practical example of constructor injection with Lombok in Spring
REST API with Jersey and Spring
Building Restful Web Services using Jersey 2 and Spring.
A Guide to ConcurrentMap
Filed under Java Concurrency, Java Map
A quick and practical guide to ConcurrentMap in Java.
Java Web Weekly, Issue 162
Filed under Weekly Review
Java 9 is starting to squash bugs, Spring Data gets a new release along with support for Cassandra 3 support and we’re discussing the Elvis operator for Java.
Guide to Guava’s Ordering
Filed under Java Collections
A guide to Guava’s Ordering class, with typical usage examples.
Guide to Try in Vavr
Filed under Java
A quick and practical guide to Vavr’s Try
Java Convenience Factory Methods for Collections
Filed under Java Collections
A quick and practical guide to creating collections and maps using Java 9 factory methods.
Building an API With the Spark Java Framework
Filed under REST
A brief tutorial on how to create a web API using Spark Framework for Java.
Guide to java.util.concurrent.Future
Filed under Java Concurrency
A guide to java.util.concurrent.Future with an overview of its several implementations
Guide to Guava Table
Filed under Java Collections
In this tutorial, we’ll show how to use the Google Guava’s Table interface and its multiple implementations.
A Guide to Spring Mobile
Filed under Spring
This article, focuses on the Spring Mobile project. We are highlighting use cases of Spring Mobile by building a sample project.
Querying Couchbase with MapReduce Views
Filed under NoSQL
Quick intro to using MapReduce views to query Couchbase.
CORS with Spring
Filed under Spring
Simple config for CORS with the built-in support in Spring MVC.
Memory Management in Java Interview Questions (+Answers)
Filed under Java
A set of popular Memory Management-related interview questions and of course answers.
Apache Maven Tutorial
Filed under Maven
A quick and practical guide to building and managing Java projects using Apache Maven.
Intro to Dropwizard Metrics
Filed under DevOps
A practical overview of Dropwizard metrics and several of its modules.
Guide to java.util.concurrent.BlockingQueue
Filed under Java Collections, Java Concurrency
Overview of java.util.concurrent.BlockingQueue with a usage example
Spring Data MongoDB: Projections and Aggregations
Filed under NoSQL, Spring Data
A quick and practical guide to Projections and Aggregations in Spring Data MongoDB
New Stream Collectors in Java 9
Filed under Java Streams
In this article, we explore new Stream collectors that were introduced in JDK 9
Java 8 Interview Questions(+ Answers)
Filed under Java
A set of popular Java8-related interview questions and of course answers.
Guide to CountDownLatch in Java
Filed under Java Concurrency
A guide to java.util.concurrent.CountDownLatch with concrete examples
Java Web Weekly, Issue 161
Filed under Weekly Review
A packed week in the Java ecosystem, discussing some of the upcoming changes in Java 9 and potentially Java 10 as well.
Intro to Spring Remoting with HTTP Invokers
Filed under Spring
A quick and practical guide on using the HTTP Invoker in Spring Remoting to invoke remote methods between client and server applications.
A Guide to TreeMap in Java
Filed under Java Map
A quick and practical guide to TreeMap in Java.
Guide to Guava RangeMap
Filed under Java Map
Learn how to use the Google Guava’s RangeMap interface and its implementations.
Guide to EJB Set-up
Filed under Jakarta EE
Quick guide to getting started with Enterprise JavaBean (EJB) development.
Guide to Guava RangeSet
Filed under Java Collections
Learn how to use the Google Guava RangeSet and its implementations through practical examples.
JSON Processing in Java EE 7
Filed under Jakarta EE, JSON
A quick and practical guide to handling JSON in Java EE 7
Java 8 Stream findFirst() vs. findAny()
Filed under Java Streams
The article explains the difference between Java 8 Stream findFirst and findAny method, in sequential and parallel scenario.
A Guide to LinkedHashMap in Java
Filed under Java Map
A quick and practical guide to LinkedHashMap in Java
Guide to Spring Handler Mappings
Filed under Spring MVC
The article explains how HandlerMapping implementation resolve URL to a particular Handler.
Concurrency with LMAX Disruptor – An Introduction
Filed under Java Concurrency
A quick introduction to LMAS Disruptor and the usage of Disruptor API
Iterable to Stream in Java
Filed under Java Streams
The article explains how to convert an Iterable to Stream and why the Iterable interface doesn’t support it directly.
Java Web Weekly, Issue 160
Filed under Weekly Review
Lots of good reactive talks, upcoming stream improvements in Java 10 and a comprehensive guide to JPQL. A good week all in all.
Guide to the Guava BiMap
Filed under Java Map
In this tutorial, we’ll show how to use the Google Guava’s BiMap interface and its multiple implementations.
Guide to Spring Retry
Filed under Spring
A quick and practical guide to implementing retry logic with Spring Retry
Exceptions in Java 8 Lambda Expressions
Filed under Java
A quick and practical guide to dealing with Lambda Expressions and exceptions
Guide to Guava Multimap
Filed under Java Map
A short guide to Guava Multimap in comparison with standard java.util.Map
Messaging with Spring AMQP
Filed under Spring
Introduction to Spring AMQP, JMS and AMQP in general
Guide to Spring Email
Filed under Spring
In this article, we’ll walk through the steps needed to send emails from both a plain vanilla Spring application as well as from a Spring Boot application.
Overview of AI Libraries in Java
Filed under Artificial Intelligence
A short overview of Artificial Intelligence libraries in Java.
Guide to Pattern Matching in Vavr
Filed under Java
A quick and practical guide for using Pattern Matching features in Vavr
Creating PDF Files in Java
Filed under Java IO
A quick and practical guide to creating PDF files in Java.
A Guide to JGit
Filed under DevOps
Learn the basics of using JGit – a Git version control written in Java.
A Guide to the Spring Task Scheduler
Filed under Spring
A quick and practical guide to scheduling in Spring with Task Scheduler
Java Web Weekly, Issue 159
Filed under Weekly Review
Java 9 is close. Lots of writeups this week focused on the upcoming release, both with the good as well as with the bad.
Parsing HTML in Java with Jsoup
Filed under Data
A quick and practical guide to parsing HTML in Java with jsoup.
HandlerAdapters in Spring MVC
Filed under Spring MVC
Learn how the Spring HandleAdapters work through runnable examples.
Set JAVA_HOME Variable in Windows, Mac OS X, and Linux
Filed under Java
A quick look at how to set the JAVA_HOME variable on Windows, Mac OS X, and Linux.
A Custom Data Binder in Spring MVC
Filed under Spring MVC
Learn to create and configure a custom data binder in Spring MVC.
How to Work with Dates in Thymeleaf
Filed under Spring MVC
A quick and practical guide to working with dates in Thymeleaf
Introduction to Apache Tomcat
Filed under DevOps
A short and practical guide to installing and configuring Apache Tomcat.
Introduction to PMD
Filed under DevOps
Learn the basics of adding and configuring static analysis with PMD on a Maven project.
Introduction to Nashorn
Filed under Java
A quick, practical intro to Nashorn, the default JavaScript engine for the JVM as of Java 8.
Introduction to Project Reactor Bus
Filed under Spring
A quick and practical example of Spring Reactor usage.
A Basic AWS Lambda Example With Java
Filed under Cloud
Learn how to create and deploy a simple AWS Lambda app in Java.
Dijkstra Shortest Path Algorithm in Java
Filed under Algorithms
An explanation and implementation of the Dijkstra Algorithm in Java
Java Web Weekly, Issue 158
Filed under Weekly Review
Starting the year strong with some cool Spring 5 news, lots of Spring Boot and a couple of solid writeups about building a career in the Java ecosystem.
Servlet 3 Async Support with Spring MVC and Spring Security
Filed under Spring MVC, Spring Security
Quick intro to the Spring Security support for async requests in Spring MVC.
Basic Introduction to JMX
Learn how to create and manage an MBean with a quick intro to JMX (Java Management Extensions).
Spring Security Context Propagation with @Async
Filed under Spring Security
A short example of propagating Spring Security context when using @Async annotation
A Custom Media Type for a Spring REST API
A quick intro to using a custom media type in a Spring REST API.
Introduction to Vavr
Filed under Java
A quick and practical guide to the Vavr library.
Java Web Weekly, Issue 157
Filed under Weekly Review
A solid last review of 2016 – focused on the Java EE report from Gartner and the new survey results, a further look at reactive and a good intro to technical debt.
Guide to @JsonFormat in Jackson
A quick and practical guide to the @JsonFormat annotation in Jackson.
The Java HashMap Under the Hood
Filed under Java Map
A quick and practical guide to Hashmap’s internals
A Guide to Rolling File Appenders
Filed under Logging
A quick and practical guide to using rolling file appenders in popular Java logging libraries
A Collaborative Filtering Recommendation System in Java
Filed under Algorithms
Quick intro to the Slope One algorithm used to build a Collaborative Filtering Recommendation system in Java.
Working with Images in Java
A quick overview of several Java image-processing libraries, including a simple example done in all of them
Guide to JAXB
Filed under XML
This is an introductory article on JAXB (Java Architecture for XML Binding).
Microsoft Word Processing in Java with Apache POI
Filed under Data
Learn how to make use of Apache POI to work with Word documents in Java.
Differences Between the Java WatchService API and the Apache Commons IO Monitor Library
Filed under Java IO
The main differences between the WatchService API from the JDK and the Apache Commons IO Monitoring Library for tracking changes in the filesystem.
Integration Patterns With Apache Camel
Filed under Architecture, Data
A quick and practical guide to systems integration patterns with Apache Camel
Java Web Weekly, Issue 156
Filed under Weekly Review
Classical MVC, good naming and Java licensing. Definitely an interesting week.
OAuth2.0 and Dynamic Client Registration (using the Spring Security OAuth legacy stack)
Filed under Spring Security
Learn how to define clients dynamically with Spring Security and OAuth2.
How to Install Maven on Windows, Linux, and Mac
Filed under Maven
Learn how to install Apache Maven on different operating systems.
The Traveling Salesman Problem in Java
Filed under Algorithms
Quick intro to simulated annealing for the traveling salesman problem in Java.
Java – Combine Multiple Collections
Filed under Java Collections
A quick and practical guide to combining multiple collections in Java
Pattern Search with Grep in Java
Filed under Spring
Learn how to write grep-like logic in Java.
Java Logging with Nested Diagnostic Context (NDC)
Filed under Logging
Distinguish log messages from different sources with the Nested Diagnostic Context.
Spring Security – @PreFilter and @PostFilter
Filed under Spring Security
Learn how to use the @PreFilter and @PostFilter Spring Security annotations through practical examples.
Introduction to Java Servlets
Filed under Jakarta EE
A quick intro to working with Java Servlets, driven by practical examples.
Intro to the Spring ClassPathXmlApplicationContext
Filed under Spring
Quick guide with an introduction to ClassPathXmlApplicationContext, which covers API, the lifecycle, and internationalization with examples.
Introduction to Spring Integration
Filed under Spring
A quick and practical guide Spring Integration
Join and Split Arrays and Collections in Java
Filed under Java Streams
A quick article with many examples of joining and splitting arrays and collections using Java Stream API.
Guide to Java URL Encoding/Decoding
Filed under Networking
The article discusses URL encoding in Java, some pitfalls, and how to avoid them.
File Size in Java
Filed under Java IO
Examples of how to get the size of a file in Java.
Introduction to HtmlUnit
A quick and practical guide to HtmlUnit
Java Class Structure and Initialization Interview Questions
Filed under Java
A set of common interview exercises from class structure and initialization in Java
Create a Fat Jar App with Spring Boot
Filed under DevOps, Spring Boot
Learn how to package a Spring Boot app into a deployable fat jar.
Guide To Java 8 Optional
Filed under Core Java
Quick and practical guide to Optional in Java 8
Intro to AspectJ
Filed under Java
This article is a quick and practical introduction to AspectJ.
Deleting Objects with Hibernate
Filed under Persistence
Quick guide to deleting an entity in Hibernate.
A Guide To NIO2 Asynchronous File Channel
Filed under Java IO
A quick and practical guide to Java NIO2 Asynchronous FileChannel API
A Guide to OkHttp
Filed under HTTP Client-Side
The basics of using OkHttp – exploring sending different types of HTTP requests, receiving and interpreting HTTP responses, and how to configure a Client.
Guide to Selenium with JUnit / TestNG
Filed under Testing
A quick guide to writing tests with Selenium in Java.
A Guide to NIO2 Asynchronous Socket Channel
Filed under Java IO
A quick and practical guide to Java NIO2 Asynchronous Socket Channel API
A Guide To NIO2 FileVisitor
Filed under Java IO
A quick and practical guide to Java NIO2 FileVisitor
A Guide To NIO2 File Attribute APIs
Filed under Java IO
A quick and practical guide to NIO2 FileAttribute in Java
How to Use the Spring FactoryBean?
Filed under Spring
A quick guide to Spring FactoryBean API with examples.
A Guide to WatchService in Java NIO2
Filed under Java IO
A quick and practical guide to Java NIO2 WatchService
Guide to JavaServer Pages (JSP)
Filed under Jakarta EE
A quick and practical intro to JSP.
Guide to Java NIO2 Asynchronous Channel APIs
Filed under Java IO
A quick and practical guide to NIO2 Asynchronous Channel APIs in Java.
Sorting in Java
Filed under Java Collections
Practical introduction to sorting in Java.
Guide to UriComponentsBuilder in Spring
Filed under Spring
A quick and practical guide to using UriComponentsBuilder in Spring
Intro to Code Quality Rules with FindBugs and PMD
Filed under DevOps
A quick and practical guide to static analysis’ code quality rules
Geolocation by IP in Java
Filed under Spring MVC
A quick and practical guide to retrieving geolocation data from a public IP address in Java
Constructor Dependency Injection in Spring
Filed under Spring
Quick and practical intro to Constructor based injection with Spring.
Java Concurrency Interview Questions (+ Answers)
Filed under Java Concurrency
A set of popular concurrency-related Java interview questions and of course answers.
Java Type System Interview Questions
Filed under Java
A set of Java type system related interview questions
SHA-256 and SHA3-256 Hashing in Java
Filed under Security
A quick and practical guide to SHA-256 hashing in Java
Guide to the Spring BeanFactory
Filed under Spring
This article explores API of Spring’s BeanFactory and gives an example how to use it.
A Guide to JUnit 5
Filed under Testing
A quick and practical guide to JUnit 5
Introduction To Apache Camel
Filed under Data, Spring Boot
A quick and practical guide to Apache Camel
Introduction to Spring Data Solr
Filed under NoSQL, Spring Data
Learn the basics of using Spring Data Solr, which integrates Spring Data with the popular Solr search engine.
Introduction to Apache CXF Aegis Data Binding
Filed under XML
An introduction to Aegis data binding, a subsystem that can map between Java objects and XML documents described by XML schemas.
PDF Conversions in Java
Filed under Java IO
A quick and practical guide to PDF conversions in Java
Getting Started with Java Properties
Filed under Core Java
Learn how to work with key-value pairs in Java using the java.util.Properties class.
Java String Conversions
Filed under Java String
Quick and practical examples focused on converting String objects to different data types in Java.
Improved Java Logging with Mapped Diagnostic Context (MDC)
Filed under Logging
Learn how to use MDC with Log4j, Log4j2 and Logback.
Custom Error Pages with Spring MVC
Filed under Spring MVC
Learn how to quickly implement an custom error page in Spring MVC (for each HTTP code)
org.springframework
Filed under Spring
An overview of org.springframework package and Spring projects.
Java 9 Stream API Improvements
Filed under Java Streams
A quick and practical guide to Java 9 Stream API additions
Introduction to Spring Cloud Rest Client with Netflix Ribbon
Filed under Spring Cloud
An introduction to Spring Cloud Rest Client with Netflix Ribbon with examples of load-balancing and failure resiliency of an enhanced RestTemplate with Ribbon.
Guide to the Java 8 forEach
Filed under Core Java
A quick and practical guide to Java 8 forEach
A Guide to HTTP Cookies in Java
Filed under Jakarta EE
A quick and practical guide to HTTP Cookies in Java
A Guide to the Java URL
Filed under Core Java
A quick and practical guide to a URL in Java
A Secondary Facebook Login with Spring Social
Filed under Spring Security
A quick look at implementing a Facebook driven authentication next to a standard form-login Spring app.
Java Collections Interview Questions
Filed under Java Collections
A set of practical Collections-related Java interview questions
Introduction to Intercepting Filter Pattern in Java
Filed under Jakarta EE
The article introduces Intercepting Filter pattern, backed with a Java based example
Introduction to FindBugs
The article introduces FindBugs the static analysis tools, used as maven, Eclipse or Intellij plugin
Introduction to the Java NIO2 File API
Filed under Java IO
A quick and practical guide to Java NIO2 File API
Working with Network Interfaces in Java
Filed under Networking
Learn how to interact with network interfaces programmatically from Java.
Convert Hex to ASCII in Java
Filed under Java String
How to convert Hex to ASCII (and back) programmatically in Java.
Java NIO2 Path API
Filed under Java IO
A quick and practical guide to the Path API in Java
A Custom Filter in the Spring Security Filter Chain
Filed under Spring Security
A quick guide to show steps to add custom filter in Spring Security context.
DynamoDB in a Spring Boot Application Using Spring Data
Filed under NoSQL, Spring Boot, Spring Data
A step by step tutorial on integrating DynamoDB in Spring Boot application using Spring Data DynamoDB.
How to Print Screen in Java
Filed under Java
A quick tutorial on how to do a Print Screen programmatically in Java
Apache CXF Support for RESTful Web Services
Filed under REST
We introduce Apache CXF as a framework compliant with the JAX-RS standard, which defines support of the Java ecosystem for the REST architectural pattern.
Custom AccessDecisionVoters in Spring Security
Filed under Spring Security
A quick and practical guide to customizing Spring Security with AccessDecisionVoters
A Guide to UDP In Java
Filed under Networking
A quick and practical guide to UDP in Java
Guide to Hazelcast with Java
Filed under Data
An intro guide to using Hazelcast in Java – and a look at the cluster, client and distributed map.
Introduction To Ehcache
Filed under Persistence
A quick and practical guide to Ehcache with a Java application
How to Create an Executable JAR with Maven
Filed under Maven
A quick and practical guide to creating executable JARs with Maven
A Guide to Cassandra with Java
Filed under NoSQL
This tutorial is an introductory guide to the Apache Cassandra database using Java.
A Guide to the Java LinkedList
Filed under Java Collections
A quick and practical guide to LinkedList in Java.
Quick Guide to MapStruct
Filed under Java
A quick and practical guide to using MapStruct
Getting Started with Spring JMS
Filed under Spring
A quick introduction to Spring JMS and its basic concepts.
Introduction to WebJars
Filed under Spring MVC
A quick and practical guide to using WebJars with Spring.
Where Is the Maven Local Repository?
Filed under Maven
Quick tutorial showing you where Maven stores its local repo and how to change that.
Introduction to the Java NIO Selector
Filed under Java IO
A quick and practical guide to NIO Selector in Java.
Thymeleaf: Custom Layout Dialect
Filed under Spring MVC
A quick and practical guide to Custom Layout Dialects in Thymeleaf with Spring
Introduction to SLF4J
Filed under Logging
A quick and to the point guide of how to use Log4j2 and Logback with SLF4J, as well as how to bridge other logging APIs such as JCL to SLF4J
REST API with Play Framework in Java
Filed under REST
A quick and practical guide to building REST APIs with Play in Java
New Features in Java 9
Filed under Core Java
A quick and practical guide to the most interesting features coming to Java 9.
Get the Current Date and Time in Java
Filed under Java Dates
This article describes how we may get the current date, current time and current time stamp in Java.
Introduction to the Wicket Framework
Filed under Jakarta EE
A quick and practical guide to the Wicket Framework
Routing in Play Applications in Java
Filed under Jakarta EE, REST
A quick and practical guide to routing in Play applications in Java
Spring and Thymeleaf 3: Expressions
Filed under Spring MVC
A quick and practical guide to using Thymeleaf’s Expression Utility Objects with Spring MVC
Introduction to Play in Java
Filed under Jakarta EE
A quick and practical introduction to Play Framework with Java.
A Guide To Java Regular Expressions API
Filed under Java
A practical guide to Regular Expressions API in Java.
How to Read a File in Java
Filed under Java IO
Quick code example of the various ways we can read a file with Java
FileNotFoundException in Java
Filed under Java IO
A quick and practical guide to FileNotFoundException in Java.
Java Web Weekly, Issue 145
Filed under Weekly Review
Lots of improvements coming to Java 9, Mockito 2 is finally out as well a Zuul proxy goodness to play with. A good week overall.
Java – Get Random Item/Element From a List
Filed under Java Collections
A quick and practical guide to picking a random item/items from a List in Java.
Introduction to Java Config for Spring Security
Filed under Spring Security
A quick and practical guide to Java Config for Spring Security
Spring MVC + Thymeleaf 3.0: New Features
Filed under Spring MVC
A quick and practical guide to using Thymeleaf 3’s new features with Spring
Generate equals() and hashCode() with Eclipse
Filed under IDE
A quick and practical guide to generating equals() and hashcode() with the Eclipse IDE
Apache Tiles Integration with Spring MVC
Filed under Spring MVC
A quick intro to using Tiles with Spring MVC.
A Guide to the Front Controller Pattern in Java
Filed under Architecture, Jakarta EE
This article explains the Front Controller pattern. It shows how the pattern is employed as a central request handler, how it applies the common behaviour and delegates request to specific handlers.
Java Annotation Processing and Creating a Builder
Filed under Java
A quick and practical guide to annotation processing in Java, showing you how to create a builder from a POJO.
Database Migrations with Flyway
Filed under Persistence
This article describes key concepts of Flyway and how we can use this framework to continuously remodel our application’s database schema reliably and easily.
MD5 Hashing in Java
Filed under Security
A quick writeup show you how to deal with MD5 hashing in Java.
Guide to Elasticsearch in Java
Filed under NoSQL
Quick and practical guide to Elasticsearch in Java.
Spring Boot Application as a Service
Filed under Spring Boot
Quick and practical guide to running a Spring Boot applications as a service
Guide to Spring Data REST Validators
Filed under REST, Spring Data
Quick and practical guide to Spring Data REST Validators
Spring, Hibernate and a JNDI Datasource
Filed under Spring Persistence
Quick and practical guide to using a JNDI datasource with Spring.
CSRF Protection with Spring MVC and Thymeleaf
Filed under Spring MVC, Spring Security
Quick and practical guide to preventing CSRF attacks with Spring Security, Spring MVC and Thymeleaf.
Using a Custom Spring MVC’s Handler Interceptor to Manage Sessions
Filed under Spring MVC
Quick and practical guide to session management with Spring MVC’s HandlerInterceptor.
Filtering a Stream of Optionals in Java
Filed under Java Streams
A quick and practical guide to filtering Streams of Optionals in Java 8 and Java 9
Batch Processing with Spring Cloud Data Flow
Filed under Spring Cloud
The second in a series on Spring Cloud Data Flow, this article is an introduction to creating batch processes with Spring Batch.
Intro to Feign
Filed under HTTP Client-Side, JSON
This article introduces Feign, a declarative HTTP client that simplifies implementation and maintaining efforts
Guide to the Java ArrayList
Filed under Java Collections
Quick and practical guide to ArrayList in Java
Deploying Web Applications in Jetty
Filed under DevOps
Quick and practical guide to deploying applications in Jetty
Guide to Java Reflection
Filed under Core Java
A simple and practical guide to Java Reflection API
web.xml vs Initializer with Spring
Filed under Spring
A quick and practical guide to XML and Java config in Spring.
A Guide to Spring Cloud Netflix – Hystrix
Filed under REST, Spring Cloud
The article shows how to set up a fallback in application logic using Spring Cloud Hystrix.
How to Deploy a WAR File to Tomcat
Filed under DevOps, Jakarta EE
An guide to deploying a WAR application into an Apache Tomcat server.
Getting Started with Stream Processing with Spring Cloud Data Flow
Filed under Spring Cloud
A intro to how to get started with Stream Processing using the Spring Cloud Data Flow platform.
Convert String to int or Integer in Java
Filed under Java String
In this article we will show multiple ways of converting a String to an int or Integer.
Convert char to String in Java
Filed under Java String
Converting char to String instances is a very common operation. In this article we will show multiple ways of tackling this simple conversion.
Hystrix Integration with Existing Spring Application
In this article we will look at how to integrate Hystrix into an existing Spring application with the help of Spring AOP.
Introduction to Spring Cloud Netflix – Eureka
Filed under Spring Cloud
Learn how to register a service and make it discoverable using Eureka
Cachable Static Assets with Spring MVC
Filed under Spring MVC
This article shows how to cache your static assets such as Javascript and CSS files when serving them with Spring MVC.
A Guide to Java Sockets
Filed under Java IO
This tutorial introduces Java sockets programming over TCP/IP with an actual Client/Server application.
Two Factor Auth with Spring Security
Filed under Spring Security
A practical two-factor authentication implementation with Spring Security 4 and the Google Authenticator mobile app.
Injecting Git Information Into Spring
Quick and practical guide to retrieving and injecting Git information using Spring and Maven
Functional Interfaces in Java 8
Filed under Core Java
Quick and practical guide to Functional Interfaces present in Java 8.
Changing Spring Model Parameters with Handler Interceptor
Filed under Spring MVC
Quick and practical guide to changing Spring model parameters with a HandlerInterceptor.
WebAppConfiguration in Spring Tests
Quick and practical guide to using @WebAppConfiguration annotation in Spring tests
Introduction to Hystrix
Filed under Cloud
Find out how Hystrix brings resilience and fault tolerance to distributed systems in our series of articles looking all aspects of Hystrix.
Java Web Weekly, Issue 139
Filed under Weekly Review
In this week’s list, some interesting Spring Boot tips and a peek into the world of AWS.
How to Run a Shell Command in Java
Filed under Java
Quick guide to how to two ways of running a shell command in Java, both on Windows as well as on UNIX.
Dockerizing a Spring Boot Application
Filed under Docker, Spring Boot
The article explains running two SpringBoot applications in different docker containers, but communicating and appearing as a single unit to the host system.
Eager/Lazy Loading in Hibernate
Filed under Persistence, Spring
Quick and practical introduction to different data loading approaches – lazy and eager – in Hibernate.
Guide To Running Logic on Startup in Spring
Filed under Spring Boot, Spring Persistence
Running logic at application startup is a common scenario. In this article we look at various ways to achieve this goal in a Spring application.
Integration Testing in Spring
A quick guide to writing integration tests for a Spring Web application.
Pagination with Spring REST and AngularJS table
An extensive look at how to implement a simple API with pagination with Spring and how to consume it with AngularJS and UI Grid.
CDI Interceptor vs Spring AspectJ
Filed under Jakarta EE, Spring
A quick look at the main differences between two different interceptor libraries: CDI Interceptor and Spring AspectJ.
Guide To CompletableFuture
Filed under Java Concurrency
Quick and practical guide to Java 8’s CompletableFuture.
Hibernate Second-Level Cache
Filed under Persistence
A guide to the Hibernate second-level cache and how to use it in practice.
Introduction to Spring MVC HandlerInterceptor
Filed under Spring MVC
Quick and practical guide to Spring MVC’s HandlerInterceptor.
Guide to JSF Expression Language 3.0
Filed under Jakarta EE
A quick look at the improvements introduced by the Expression Language v3.0 in JSF.
Jackson vs Gson
Quick and practical guide to serialization with Jackson and Gson.
JPA Criteria Queries
Filed under Persistence
Quick and practical guide to using Criteria Queries mechanism in Hibernate
Introduction to JSONForms
Filed under JSON
In this article we cover an introduction to JSONForms.
Asynchronous Batch Operations in Couchbase
Learn how to perform efficient batch operations in Couchbase using the asynchronous Couchbase Java API.
Mapping with Orika
Filed under Data
Introduction to easy mapping with the Orika Java Bean mapping framework.
Cucumber Spring Integration
Quick guide to integrate the Cucumber testing framework with Spring.
Intro to JaCoCo
A quick intro to using the JaCoCo maven plugin to generating test coverage reports.
Quick Intro to Spring Cloud Configuration
Filed under Spring Cloud, Spring Security
A quick intro to using a git repository as a storage for our project configuration, using Spring Cloud.
A Guide to Mapping With Dozer
Filed under Data
Dozer is a Java Bean to Java Bean mapper that copies data from one object to another, attribute by attribute, supports mapping between attribute names, does type conversion, and many other things.
JMockit Advanced Usage
Filed under Testing
A quick and practical guide to advanced JMockit utilities.
Spring JSON-P with Jackson
The article is focused on showing how to use the new JSON-P support in Spring 4.1.
Introduction to Immutables
Filed under Data
A quick and practical intro to the Immutables library – used to generate immutable objects via the use of annotations.
A Custom Security Expression with Spring Security
Filed under Spring Security
A guide to creating a new, custom security expression with Spring Security, and then using the new expression with the Pre and Post authorize annotations.
Introduction to AutoValue
Filed under Java
AutoValue is a source code generator for value objects; simply put – it auto-generates the value-type objects with toString(), equals() and hashCode() implementations
Introduction to Spring with Akka
A quick and practical guide to using Akka with Spring
Quick Guide to Spring MVC with Velocity
Filed under Spring MVC
A quick and practical guide to using Spring MVC with Velocity.
Intro to Spring Security Expressions
Filed under Spring Security
Simple and practical guide to Spring Security Expressions.
Introduction To XMLUnit 2.x
A guide to using XMLUnit 2.x to test, verify and validate XML in Java.
A Guide to FastJson
Filed under JSON
The basics of FastJson – a lightweight but powerful library for working with JSON in Java.
A Guide to REST-assured
Filed under HTTP Client-Side, JSON, REST, Testing
Explore the basics of REST-assured – a library that simplifies the testing and validation of REST APIs.
Quick Guide to @RestClientTest in Spring Boot
Filed under Spring Boot, Spring Web, Testing
A quick and practical guide to the @RestClientTest annotation in Spring Boot
Circular Dependencies in Spring
Filed under Spring
A quick writeup on dealing with circular dependencies in Spring: how they occur and several ways to work around them.
A Guide to JMockit Expectations
Filed under Testing
Quick and practical guide to JMockit’s expectations.
Intro to the Jackson ObjectMapper
The article discusses Jackson’s central ObjectMapper class, basic serialization and deserialization as well as configuring the two processes.
Check if Two Lists Are Equal in Java
Filed under Java Collections
A short article focused on the common problem of testing if two List instances contain the same elements in exactly the same order.
A Guide to Apache CXF with Spring
Filed under Spring
Quick tutorial on how to use Apache CXF with the Spring Framework and how to configure it either using Java or XML.
Mutation Testing with PITest
Filed under Testing
This article briefly introduces mutation testing using the PITest library
What’s New in Spring 4.3?
Filed under Spring
A quick and practical guide to the new and cool additional of the Spring 4.3 release.
Intro to Spring Boot Starters
Filed under Spring Boot
A quick overview of the most common Spring Boot Starters, along with examples on how to use them in a real-world project.
Using Couchbase in a Spring Application
Filed under NoSQL, Spring Persistence
Create a persistence layer in a Spring application using Couchbase.
Intro to Jedis – the Java Redis Client Library
Filed under NoSQL
An introduction to Jedis, a client library in Java for Redis – the popular in-memory data structure store that can persist on disk as well.
A Guide to Spring in Eclipse STS
A quick guide to working with Spring using the Eclipse Spring Tool Suite (STS) IDE.
AssertJ’s Java 8 Features
Filed under Testing
Learn about AssertJ Java 8 related features such as Optionals, Predicates and the new LocalDate/Time APIs.
Binary Data Formats in a Spring REST API
In this article we explore how to configure Spring REST mechanism to utilize binary data formats which we illustrate with Kryo. Moreover we show how to support multiple data formats with Google Protocol buffers.
Minification of JS and CSS Assets with Maven
Filed under Maven
A quick guide to using Maven to minify Javascript and CSS files in a Java web project.
Hibernate: save, persist, update, merge, saveOrUpdate
Filed under Persistence
A quick and practical guide to Hibernate write methods: save, persist, update, merge, saveOrUpdate.
Introduction to Apache CXF
Filed under Jakarta EE
This tutorial is the first of a series on Apache CXF, introducing basic characteristics of the framework.
Introduction to JSF EL 2
Filed under Jakarta EE
The article discusses the JSF EL. It contrast it against the JSP EL, but also discusses the weaknesses
Introduction to Java Logging
Filed under Logging
A quick intro to logging in Java – the libraries, the configuration details as well as pros and cons of each solution.
AssertJ for Guava
Filed under Testing
This article focuses on AssertJ Guava-related assertions and is the second article from the AssertJ series.
Introduction to JSON Schema in Java
Filed under JSON
A beginner’s look at JSON Schema: a declarative language for validating the format and structure of a JSON Object.
Wiring in Spring: @Autowired, @Resource and @Inject
Filed under Spring
This article will compare and contrast the use of annotations related to dependency injection, namely the @Resource, @Inject, and @Autowired annotations.
Stored Procedures with Hibernate
Filed under Persistence
This article shortly discusses how to call store procedures from Hibernate.
Intro to Querydsl
Filed under Persistence
A simple and practical guide to Querydsl.
JMockit 101
Filed under Testing
A simple and practical guide to testing and mocking with JMockit.
Introduction to Couchbase SDK for Java
Filed under NoSQL
A quick and practical intro to using the Java Couchbase SDK.
Testing with Hamcrest
Filed under Testing
In this very practical tutorial, we focus on using the Hamcrest API and on writing neater and more intuitive unit tests for our software.
Introduction to the Java 8 Date/Time API
Filed under Java Dates
In this article we will take a look at the new Java 8 APIs for Date and Time and how much easier it is to construct and manipulate dates and times.
XML Libraries Support in Java
Filed under XML
A quick and practical guide to XML Java tools
Spring MVC and the @ModelAttribute Annotation
Filed under Spring MVC
A quick, practical writeup about the @ModelAttribute annotation in Spring MVC.
Introduction to AssertJ
Filed under Testing
AssertJ is an open-source library for writing fluent and rich assertions in Java tests. This article focuses on tools available in the basic AssertJ-core module.
Migrating to the New Java 8 Date Time API
Filed under Java Dates
A quick and practical guide on transitioning to Java 8’s new DateTime API.
Spring REST API with Protocol Buffers
A quick and practical introduction to using Protocol Buffers with Spring REST APIs.
Mockito vs EasyMock vs JMockit
Filed under Testing
A quick and practical guide to understanding and comparing Java mocking libraries.
Guava Set + Function = Map
Filed under Java Collections
A short example showing how to apply a function against a Set, and convert a set into a Map.
A Quick Guide to Spring MVC Matrix Variables
Filed under REST, Spring MVC
A short guide about Spring MVC matrix variables, explaining what they are and how to use them to simplify our requests.
The Java 8 Stream API Tutorial
Filed under Java Streams
The article is an example-heavy introduction of the possibilities and operations offered by the Java 8 Stream API.
Scheduling in Jakarta EE
Filed under Jakarta EE
A demonstration of how to schedule tasks in Jakarta EE using the @Schedule annotation and the timer service.
Introduction to Project Lombok
Filed under Java
A comprehensive and very practical introduction to many useful usecases of Project Lombok on standard Java code.
Load Testing Baeldung with Gatling
Filed under Testing
A quick writeup on using Gatling to writing a simple load test for a site and running that test to get some performance data out of it.
A Guide to Java Enums
Filed under Core Java
A quick and practical guide to the use of the Java Enum implementation, what it is, what problems it solves and how it can be used to implement commonly used design patterns.
Intro to XPath with Java
A quick and practical intro to working with XPath with the help of the standard Java libraries.
Intro to Gatling
Filed under Testing
A quick introduction to the Gatling performance tool and how to record a simple test scenario with it.
Spring Boot Support for jOOQ
Filed under Spring Boot, Spring Persistence
A quick guide to Spring Boot support for jOOQ
Introduction to WireMock
A quick and practical guide to stubbing REST APIs with WireMock.
REST API Testing with Cucumber
A quick on on REST API testing with Cucumber.
Guide to Spring @Autowired
Filed under Spring
A guide to the most commonest usage of Springs @Autowired annotation and qualifiers
Multiple Buckets and Spatial View Queries in Spring Data Couchbase
Filed under NoSQL, Spring Data
Learn how to configure Spring Data Couchbase to support multiple buckets and use the repository to write spatial view queries against multi-dimensional data.
JavaServer Faces (JSF) with Spring
Filed under Spring MVC
A quick introduction into setting up JSF and the Spring Framework. It showcases how Spring beans can be accessed from JSF pages and JSF managed beans.
New Features in Java 8
Filed under Core Java
A short intro into the new features of Java 8; the focus is on default and static interface methods, static method references, and Optional.
Introduction to Java 8 Streams
Filed under Java Streams
A quick and practical introduction to Java 8 Streams.
Purging Expired Tokens Generated by the Registration
A quick writeup on how to clean up the expired verification registration tokens that are left behind by the registration process.
Introduction to Spring REST Docs
This article introduces Spring REST Docs, a test-driven mechanism to generate documentation for RESTful services that is both accurate and readable.
XML Serialization and Deserialization with Jackson
This short tutorial shows how the Jackson library can be used to serialize Java object to XML and deserialize them back to objects.
Spring Security – Run-As Authentication
Filed under Spring Security
Set up a Spring Security application to allow a user to execute logic as another principal with different privileges.
Returning Image/Media Data with Spring MVC
Filed under Spring MVC
The article shows the alternatives for returning image (or other media) with Spring MVC and discusses the pros and cons of each approach.
Intro to WebSockets with Spring
Filed under Spring
A quick intro to using WebSockets with Spring from a JS client.
Spring HTTP/HTTPS Channel Security
Filed under Spring Security
The article briefly demonstrates how to protect sensitive data by configuring HTTPS and discuss further configuration details of the channel security feature.
Mockito’s Mock Methods
Filed under Testing
This tutorial illustrates various uses of the standard static mock methods of the Mockito API.
Introduction to PowerMock
Filed under Testing
This article demonstrates the use of the PowerMockito extension to Mockito’s capabilities, including the mocking of static, final, and private methods.
Guide to the Fork/Join Framework in Java
Filed under Java Concurrency
An intro to the fork/join framework presented in Java 7 and the tools to help speed up parallel processing by attempting to use all available processor cores.
An Intro to Spring HATEOAS
A quick intro to using Spring HATEOAS to add Hypermedia to a practical Spring API.
Spring Expression Language Guide
Filed under Spring
This article explores Spring Expression Language (SpEL), a powerful expression language that supports querying and manipulating object graphs at runtime.
XStream User Guide: JSON
Filed under XML
This article covers the XStream XML processing library’s JSON processing capabilities.
Entity Validation, Optimistic Locking, and Query Consistency in Spring Data Couchbase
Filed under NoSQL, Spring Data
A guide to entity validation, optimistic locking and query consistency with Spring Data Couchbase.
Java – Byte Array to Writer
Filed under Java IO
A quick guide to converting a byte array to a Writer using Java, Guava or Commons IO.
File Upload with Spring MVC
Filed under Spring MVC
In this article, we focus multipart (file upload) support in Spring MVC web applications.
Zipping and Unzipping in Java
Filed under Java IO
Learn how to zip and unzip a file, multiple files or a full directory using core Java.
XStream User Guide: Converting XML to Objects
Filed under XML
This article demonstrates how to use XStream to deserialize XML to Java objects.
Introduction to Jooq with Spring
Filed under Spring Persistence
Learn how to set up and use Jooq (jOOQ Object Oriented Querying) with the Spring Framework.
XStream User Guide: Converting Objects to XML
Filed under XML
In this tutorial, we will learn how to use the XStream library to serialize Java objects to XML.
More Jackson Annotations
This article covers some lesser-known JSON processing annotations provided by Jackson.
Elasticsearch Queries with Spring Data
Filed under NoSQL, Spring Data
Learn how to use the various query types offered by Elasticsearch and understand field analyzers and their impact on search results.
PubSub Messaging with Spring Data Redis
Filed under NoSQL, Spring Data
Learn how to do the implementation of pub/sub messaging using Spring Data Redis.
Introduction to Spring Data REST
Filed under REST, Spring Data
This article will explain the basics of Spring Data REST and show how to use it to build a simple REST API.
Spring MVC Content Negotiation
Filed under REST, Spring MVC
A guide to configuring content negotiation in a Spring MVC application and on enabling and disabling the various available strategies.
Intro to Spring Data Couchbase
Filed under NoSQL, Spring Data
Quick and practical into to using Spring Data Couchbase to interact with a Couchbase DB Server.
A Guide to Stored Procedures with JPA
Filed under JPA
A quick, practical guide to using Stored Procedures with the Java Persistence API (JPA).
A Guide to Querydsl with JPA
Filed under JPA
A quick guide to using Querydsl with the Java Persistence API.
Inheritance with Jackson
This tutorial will demonstrate how to handle inclusion of subtype metadata and ignoring properties inherited from superclasses with Jackson.
Exploring SpringMVC’s Form Tag Library
Filed under Spring MVC
A quick and to the point tutorial about the various tags that Spring MVC provides to help us create and validate forms.
Introduction to JsonPath
Filed under JSON
1. Overview One of the advantages of XML is the availability of processing — including XPath — which is defined as a W3C standard. For JSON, a similar tool called JSONPath has emerged. This tutorial will give an introduction to Jayway JsonPath, a Java implementation of the JSONPath specification. It describes setup, syntax, common APIs […]
A Guide to the Java ExecutorService
Filed under Java Concurrency
An intro and guide to the ExecutorService framework provided by the JDK – which simplifies the execution of tasks in asynchronous mode.
Using Apache Camel with Spring
Filed under Spring
This article will demonstrate how to configure and use Apache Camel with Spring Framework through a simple, practical example.
Protected: Spring Persistence (Hibernate and JPA) with a JNDI datasource
Filed under Persistence, Spring
There is no excerpt because this is a protected post.
RESTEasy Client API
Filed under HTTP Client-Side, REST
A quick guide to building out a client for the REST API using RESTEasy.
Define Custom RAML Properties Using Annotations
Filed under REST
Learn how to extend the metadata for a RAML API specification through the use of custom properties called annotations.
All Spring Data Guides
Filed under Series, Spring Data
A quick guide to all the Spring Data articles here on Baeldung.
A Guide to RESTEasy
Filed under REST
A quick guide to building a REST API using RESTEasy.
Guava 19: What’s New?
Filed under Java
Overview of the features introduced in Google Guava 19.
Introduction to Spring Data Elasticsearch
Filed under NoSQL, Spring Data
In this article we explore the basics of Spring Data Elasticsearch and we show how to index, search, and query data with the framework.
Modular RAML Using Includes, Libraries, Overlays and Extensions
Filed under REST
Learn to modularize your RAML definition with Includes, Libraries, Overlays and Extensions.
Introduction to Spring Data Redis
Filed under NoSQL, Spring Data
A quick and practical introduction to Spring Data Redis, which provides abstractions from the Spring Data platform for Redis.
A Guide to the ViewResolver in Spring MVC
Filed under Spring MVC
A quick and practical guide to using the various view resolvers in a Spring MVC application.
Spring REST with a Zuul Proxy
Filed under REST, Spring Cloud
Exploring the use of the Zuul proxy for a Spring REST API, working around CORS and the same-origin policy constraint of the browser.
The Double Colon Operator in Java 8
Filed under Java
A quick guide to the double colon operator in Java 8 and how it should be used in practice.
Working with Tree Model Nodes in Jackson
Learn how to create, find and manipulate JsonNode objects in Jackson 2.
A Guide to CSRF Protection in Spring Security
Filed under Spring Security
Learn how CSRF attacks work on a practical Spring application, and then how to enable protection against these kinds of attacks with Spring Security.
Introduction to Using FreeMarker in Spring MVC
Filed under Spring MVC
FreeMarker is a Java based template engine from the Apache Software Foundation. This tutorial illustrates how to configure FreeMarker for use in Spring MVC.
Auditing with JPA, Hibernate, and Spring Data JPA
Filed under JPA
This article demonstrates three approaches to introducing auditing into an application: JPA, Hibernate Envers, and Spring Data JPA.
Custom Error Message Handling for REST API
Implement a Global Exception Handler for a REST API with Spring.
Protected: Java – Zip and unzip a collection of files
Filed under Spring
There is no excerpt because this is a protected post.
Injecting Mockito Mocks into Spring Beans
This article will show how to use dependency injection to insert Mockito mocks into Spring Beans for unit testing.
Eliminate Redundancies in RAML with Resource Types and Traits
Filed under REST
In this tutorial, we’ve shown how to significantly reduce or, in some cases, eliminate redundancies from a RAML API definition.
Introduction to Using Thymeleaf in Spring
Filed under Spring MVC
Thymeleaf is a templating language with excellent integration with Spring. This article provides an introduction to using Thymeleaf in a Spring MVC application.
Lambda Expressions and Functional Interfaces: Tips and Best Practices
Filed under Java
Tips and best practices on using Java 8 lambdas and functional interfaces.
Java – Try with Resources
Filed under Core Java
A quick and practical guide to how we can use the try-with-resources functionality introduced in Java 7 to auto-close resources and simplify our syntax.
Guava 18: What’s New?
Filed under Java
Overview of the features introduced in Google Guava 18.
Using the CassandraTemplate from Spring Data
Filed under NoSQL, Spring Data
A primer on using Spring Data Cassandra’s CassandraTemplate to perform basic queries using QueryBuilder and CQL.
Introduction to Advice Types in Spring
Filed under Spring
A quick intro to AOP in Spring and working with Advice types to cross-cut across your application concerns.
Introduction to Pointcut Expressions in Spring
Filed under Spring
A quick and practical intro to Spring AOP and Pointcut Expressions.
An Introduction to Grails 3 and GORM
Filed under Persistence, Spring
A very quick intro to Grails and GORM, to be used as a guide to getting started with the framework.
Introduction to Spring Data Cassandra
Filed under NoSQL, Spring Data
A quick practical intro to using Spring Data Cassandra to cleanly store data in a Cassandra server.
Setting Up Swagger 2 with a Spring REST API Using Springfox
Learn how to document a Spring REST API using Swagger 2.
A Guide to XML in Java
A quick guide and overview of the XML landscape in the Java ecosystem.
Introduction to RAML – The RESTful API Modeling Language
Filed under REST
The definitive intro to RAML – the RESTful API Modeling Language.
Spring Data MongoDB Tutorial
Filed under NoSQL, Series, Spring Data
This is a guide to Spring Data MongoDB – from a quick intro on how to hit the ground running in a Spring project, to queries and more complex features.
Sixth Round of Improvements to the Reddit Application
Finishing up the reddit application with a quick round of improvements.
Java Bean Validation Basics
Filed under Jakarta EE
Learn the basics of Java Bean validation, the common annotations and how to trigger the validation process.
Spring Bean Annotations
Filed under Spring
Learn how and when to use the standard Spring bean annotations – @Component, @Repository, @Service and @Controller.
GridFS in Spring Data MongoDB
Filed under NoSQL, Spring Data
A quick guide to interacting with GridFS using Spring Data MongoDB.
A Spring Custom Annotation for a Better DAO
Filed under Spring Persistence
A cool implementation of a custom Spring annotation along with a bean pre-processor to get to a simple, generic DAO implementation.
JSON API in a Spring Application
Learn how to use the JSON-API spec to power a Hypermedia API in a Java/Spring web application.
Scheduling in Spring with Quartz
Filed under Spring
Quick introduction to working with Quartz in Spring.
Fifth Round of Improvements to the Reddit Application
We separate the front end and the API into their own servlets, introduce email notifications on Reddit comments and generally make things better.
The Guide to RestTemplate
Filed under HTTP Client-Side, Spring Web
Learn how to use the Spring RestTemplate to consume an API using all the main HTTP Verbs.
Fourth Round of Improvements to the Reddit Application
Improvements to the registration flow of the reddit app, converting the project to Boot, handling session timeout and disabling the user. Improvements galore.
Preserve the History of Reddit Post Submissions
A significant improvement in the Reddit app case study – we’re not keeping track of the full history of actions for posts.
Java Base64 Encoding and Decoding
Filed under Java
How to do Base64 encoding and decoding in Java, using the new APIs introduced in Java 8 as well as Apache Commons.
Custom Cascading in Spring Data MongoDB
Filed under NoSQL, Spring Data
How to implement a solid, generic cascading mechanism with lifecycle events in Spring Data MongoDB.
Spring Data MongoDB – Indexes, Annotations and Converters
Filed under NoSQL, Spring Data
How to work with Indexes, Converters and Common Annotations in Spring Data MongoDB.
Entity To DTO Conversion for a Spring REST API
How to to simpler conversions from Entities to DTOs and back in a Spring REST API.
A Guide to Queries in Spring Data MongoDB
Filed under NoSQL, Spring Data
How to Query MongoDB with Spring Data: Query and Criteria, auto-generated repository methods, raw queries with the @Query annotation as well as QueryDSL.
Use Liquibase to Safely Evolve a Database Schema
Filed under Persistence
How to use Liquibase to safely and maturely evolve the database schema of your Java app.
Externalize Setup Data via CSV in a Spring Application
Filed under Spring Data
Learn how to use CSV files to hold the Setup data for a Spring web application, and how to fully load and persist that data from disk.
Introduction to Spring Data MongoDB
Filed under NoSQL, Spring Data
A solid intro to using MongoDB in with Spring Data.
Third Round of Improvements to the Reddit Application
Improving the Reddit app in the case study with: better tables, email notifications, simple voting rules and extra validation.
Adding Roles and Privileges To the Reddit App
Simple Roles and Privileges added to the app, a scheduling limit for standard users and a basic admin screen.
Testing the API of the Reddit App
Basic API testing for the ever evolving Reddit Application.
Decoupling Registration from Login in the Reddit App
New basic registration flow and simple form-based login to replace the “Login and Register” via Reddit. The app now has a clean auth process all around.
Displaying Dates in the Timezone of the User
Filed under Java Dates, REST, Spring
How to make the timezone configurable in the Reddit app and display all dates according to the timezone of the user.
A User Profile in the Reddit App
A simple User Profile implementation with Spring and Spring Security.
Second Round of Improvements to the Reddit Application
The Case Study following the process of building an Reddit Web App is evolving nicely with this second round of improvements and new functionality.
Retry to Submit to Reddit a Post Without Enough Traction
A new feature in the case-study Reddit app – delete and retry a Post that’s not getting traction early on.
Make It Easy to Schedule to Reddit
Filed under Spring
Building a new feature into the case-study app – scheduling a post to Reddit from the RSS feed of a pre-defined site.
Rate Limiting Access to the Reddit API
How to introduce rate limiting into an app when consuming an external API.
First Round of Improvements to the Reddit Application
The reddit app in this case study is coming along and slowly starting to become usable.
A Reddit Application with Spring
A case study on building a small application to schedule Posts to the Reddit API using Spring.
Jackson JSON Tutorial
Learn Jackson 2 inside out – the marshalling and the unmarshalling from basic mapping to advanced techniques and exceptions.
Apache HttpClient Tutorial
Filed under HTTP Client-Side, Series
Comprehensive Guide to the Apache HttpClient – start with basic usage and make your way though the advanced scenarios.
Building a REST Query Language
Learn how to implement a Search / Query Language for your Spring REST API.
Registration – Password Strength and Rules
Filed under Spring Security
How to implement a client side password strength meeter and server side password rules for a simple Spring Registration app.
Schedule Post to Reddit with Spring
How to build a simple Spring app to schedule, edit and delete Posts using the Reddit API.
Post a Link to the Reddit API
A basic interaction with the Reddit API – posting a new Link, using Spring Security OAuth2.
Spring Security Registration Tutorial
Filed under Series, Spring Security
Building a full-fledged, production ready registration for your web app is oh so much more than just putting together a simple registration page.
Spring Security Authentication Tutorial
Filed under Series, Spring Security
How to build a production-grade Registration process for new users, and Login flow for existing users.
Jackson Date
Filed under Jackson, Java Dates
How to process dates with Jackson – marshalling and unmarshalling these to and from JSON.
The Registration Process With Spring Security
Filed under Spring Security
Implement a full registration with Spring Security and Spring MVC.
Java “Back to Basics” Tutorial
Java “Back to Basics” Tutorial – illustrating Collections and Java IO.
Cookbooks
Filed under Series
Programming Cookbooks – Guava, Mockito, Hamcrest, Jackson and the HttpClient – simple examples to play with.
Http Message Converters with the Spring Framework
Filed under Spring MVC
How to configure HttpMessageConverters for a REST API with Spring, and how to use these converters with the RestTemplate.
Java 8 – Powerful Comparison with Lambdas
Filed under Java
Elegant Sort in Java 8 – Lambda Expressions go right past syntactic sugar and bring powerful functional semantics into Java.
Security with Spring
Filed under Series, Spring Security
Security with Spring Tutorial – how to Secure an MVC project, Login and Logout, how to Secure a REST Service using OAuth.
Spring Exceptions Tutorial
Some of the most common exceptions in Spring with examples – why they occur and how to solve them quickly.
REST with Spring Tutorial
Step by step tutorial on building a REST API with Spring (and securing it with Spring Security).