How to use Jackson to break the infinite recursion problem on bidirectional relationships.
Search Results for: maven
Jackson Exceptions – Problems and Solutions
The most common Jackson exceptions – the cause of the problem and the solution for each one.
Baeldung Weekly Review 50
JDK 9 modularization news, Java 8 streams and Spring Boot – what more can you expect from a good week like this one?
Baeldung Weekly Review 49
One of the more eventful weeks of the year, with some fantastic Spring Boot pieces (and new releases), musings on CQRF and a good read on Flexibility vs Simplicity.
Java – Directory Size
Calculate the Size of a Directory with Java 6, 7 and 8 as well as Apache Commons IO and Guava.
Getting Started with Mockito @Mock, @Spy, @Captor and @InjectMocks
How to use annotations in Mockito – @Mock, @Spy, @Captor and @InjectMocks and the MockitoJUnitRunner to enable them.
Spring Events
The Basics of Events in Spring – create a simple, custom Event, publish it and handle it in a listener.
Spring Profiles
How to define and use Profiles in Spring. The 4 ways to enable profiles and their precedence. And a real-world example using profiles.
Mockito – Using Spies
Making good use of Spies in Mockito, and how spies are different from mocks.
Build a REST API with Spring and Java Config
Building a REST Service with Spring and Java based Configuration, HTTP response codes, REST payloads and marshalling, testing.
Baeldung Weekly Review 41
Wide array of articles from HTTP/2 moving forward, through using testing as the main driver of your design and to the useful lessons in Microservices.
Filtering and Transforming Collections in Guava
Filter collections with Predicates and transform them with Functions using the Guava library.
Java – Generate Random String
Generate Bounded and Unbounded Random Strings using plain Java and the Apache Commons Lang library.
The Baeldung Weekly Review 33
A strong week for the Java/Spring ecosystem – new Java 9 JEPs announced, a REST API being built and some good thoughts on testing.
Getting Started with Forms in Spring MVC
Learn how to work with forms using Spring MVC – mapping a basic entity, submit, displaying errors.
Java – Random Long, Float, Integer and Double
Learn how to generate random numbers in Java – both unbounded as well as within a given interval.
Apache HttpClient Connection Management
How to open, manage and close connections with the Apache HttpClient 4.
Java – Convert File to InputStream
How to open an InputStream from a Java File – using plain Java, Guava and the Apache Commons IO library.
Project Configuration with Spring
This article discusses an simple yet flexible solution to configuration that is specific to the environment with Spring.
Removing All Duplicates From a List in Java
How to remove all duplicate elements from a List – first with plan Java, then Guava and finally with Java 8 lambdas.