A guide to @Value in Spring Boot

The @Value annotation is the quickest way to access the application.properties values in Spring Boot. It comes with some powerful features which we will explore in this tutorial. @Value Annotation in Spring Boot The @value annotation is the easiest way to inject values into primitive fields. To demo this, let’s set up an application with…

This application has no explicit mapping for /error

The “this application has no explicit mapping for /error” view is a common Spring Boot-related issue. If you are new to Spring Boot, you might have seen this error already. If you are looking for how to solve this issue, This is what you should do. What and why? You would usually see this error…

Docker setup for MySQL and phpMyAdmin

In this post, we will take a look at how to set up a MySQL database and phpMyAdmin in a local machine using docker for application development. After completing this tutorial, you will know how to run the MySQL database locally. Background Let’s face it. The hardest part of the development is setting up the…

Injecting collection of objects in Spring

Spring boot can inject/autowire a collection of objects directly as dependencies to other beans and components. Let’s see how to make use of this feature with an example. We so far have seen the constructor dependency injection and setter dependency injection. In these posts, we only saw autowiring of single object parameters. But Spring framework…

Content negotiation with Spring Boot

In this post we will see how to implement content negotiation in a Spring Boot application. Introduction You may have written RESTful API endpoints where the client sends JSON request and the server sends back a JSON response. However, What would you do if the client can only understand XML? Obviously, You need to write extra logic for XML representation of…

Firebase Cloud Messaging for push notifications From Spring Boot

Let’s learn how to send push notifications to iOS and Android mobile devices via Firebase cloud messaging(FCM) service using Spring Boot for example. Mobile notifications play a major role in user engagement. With Firebase’s new SDK for Java, sending Firebase push notifications from a Spring Boot application got a lot easier. 1) Setup Firebase messaging…

Thymeleaf views from database in Spring Boot

In this post, We will learn how to load thymeleaf views from the database without restarting the spring boot application. Problems with thymeleaf view files You have seen how to load thymeleaf templates for views or HTML emails. The problem with thymeleaf views is that you need to make a new build when you make…

Spring Boot Email using Thymeleaf with Example

Let us see how to send HTML emails using thymeleaf templates in a spring boot application. Things got easier with spring boot and thymeleaf template engine. As you know, Thymeleaf is used as a View in Spring MVC applications. However, do you know you can use the same template Engine for generating rich HTML emails?…

FreeMarker vs Groovy vs Mustache vs Thymeleaf

In this post, we will try to compare FreeMarker vs Groovy vs Mustache vs Thymeleaf with examples. Spring Boot supports FreeMarker, Groovy, Mustache and Thymeleaf. But, how do they compare with each other? Let’s find out which template engine is the best for different use-cases in spring boot. For this comparison, I have created four…

Spring Boot Custom Health Indicators

In this post, We will learn about writing Custom Health Check indicators for Spring Boot Applications. Spring Boot out-of-the-box health checks are good. But in the real world, it is often the case that one application relies on another application’s availability for performing operations. In this case, it would be helpful to add a health…