Posts in "Java"

Spring Boot Custom Banner Example

In this post, I’ll show you how easy it is to create a custom banner for your Spring Boot application. Step 1: Generate the banner The easiest way to generate a custom banner is online. There are plenty of sites out there that offer this functionality. Just google “spring boot custom banner generator” and you’ll… Continue reading

Create Applications with Angular and Spring Boot Course

Spring Boot and Angular are two technologies that are becoming more and more popular. But combining them can be a little bit challenging, especially for developers familiar with more legacy JavaScript frameworks. That’s why I decided to create a video course that will teach you everything you need to create applications with Angular and Spring… Continue reading

Send emails in Spring Boot

If you are looking for a fast tutorial on how to send emails in Spring Boot applications, then you landed in the right place 😀 1) Add the spring-boot-starter-mail dependency to the pom.xml file <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> 2) Configure a mail server for testing purposes. I would recommend Mailtrap, a free online service for… Continue reading

Install a Spring Boot Application as a Windows Service

Spring Boot applications are versatile by nature and provide a lot of deployment possibilities. In this post, I am going to show you how to install a Spring Boot application as a Windows service. It is a fairly simple process that should take a couple of minutes 😉 1. Sample Application For this demo, I… Continue reading

Fix Truncation of @PathVariable After Dot in Spring MVC

The Problem Recently, while working on a project I encountered a strange behavior with the path variable binding in Spring controllers. It seems that, by default, the text after the last dot gets truncated in the @PathVariable value. So I decided to share this problem and a solution for it in this post:) Let’s take… Continue reading

Spring Conditional Bean Configuration: Load Beans Based on Custom Conditions

In a previous post, I made a small demo on how to load Java beans based on properties defined in a configuration file. While this is a very common scenario, sometimes you might need to create beans based on completely custom conditions. Once again, Spring provides an elegant solution for this: the @Conditional annotation. The… Continue reading

Spring Conditional Bean Configuration: Load Beans Based on Application Properties File

In complex applications, there are times when you will want the Spring dependency injector to create an instance of a class based on a given condition. One common case is to configure the bean definition based on a property defined in the application.properties file. By using this approach you can load custom beans at runtime… Continue reading

How to deploy Spring Boot applications on Tomcat (as WAR)

By default, Spring-Boot applications are packaged as JAR files and they have an embedded container that hosts them. The embedded container allows developers to not have any web server installed in order to run their apps. This is pretty cool and brings many benefits for developers like easier deployment and management. However, customers usually have… Continue reading