Unsatisfied Dependency in Spring 1. Overview In this quick tutorial, we’ll explain Spring’s UnsatisfiedDependencyException, what causes it, and how to avoid it. 2. Cause of UnsatisfiedDependencyException UnsatisfiedDependencyException gets thrown when, as the name suggests, some bean or property dependency isn’t satisfied. This may happen when Spring application tries to wire a bean and cannot… Continue Reading spring-unsatisfied-dependency

Spring Request Parameters with Thymeleaf 1. Introduction In our article Introduction to Using Thymeleaf in Spring, we saw how to bind user input to objects. We used th:object and th:field in the Thymeleaf template and @ModelAttribute in the controller to bind data to a Java object. In this article, we’ll look… Continue Reading spring-thymeleaf-request-parameters

Mapping a Dynamic JSON Object with Jackson 1. Introduction Working with predefined JSON data structures with Jackson is straightforward. However, sometimes we need to handle dynamic JSON objects, which have unknown properties. In this short tutorial, we’ll see multiple ways of mapping dynamic JSON objects into Java classes. Note that in… Continue Reading jackson-mapping-dynamic-object

Configuring a DataSource Programmatically in Spring Boot 1. Overview Spring Boot uses an opinionated algorithm to scan for and configure a DataSource. This allows us to easily get a fully-configured DataSource implementation by default. In addition, Spring Boot automatically configures a lightning-fast connection pool — either HikariCP, Apache Tomcat, or Commons DBCP, in… Continue Reading spring-boot-configure-data-source-programmatic

Logout in an OAuth Secured Application 1. Overview In this quick tutorial, we’re going to show how we can add logout functionality to an OAuth Spring Security application. We’ll, of course, use the OAuth application described in a previous article – Creating a REST API with OAuth2. 2. Remove the… Continue Reading logout-spring-security-oauth