Posts tagged "java"

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

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 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

Create a UDP Client-Server in Java Using the Producer Consumer Pattern

In a previous post, I created a simple UDP client-server in Java. While that implementation is perfectly OK, and you can certainly use it in your applications, it does have 2 major pitfalls: The UDP client has more responsibilities than it has to. It listens on UDP for incoming messages, but it also handles their… Continue reading

Create a Simple UDP Client-Server in Java

From my experience, creating networking applications in modern programming languages is not a daunting task anymore. A lot of the complicated details are abstracted in base class libraries. And Java is no exception. In this post, you will see how to create a basic client-server application that¬†communicates via¬†UDP unicast. Without further ado, let’s write some… Continue reading

Spring Boot 101 Tutorials

Spring Boot is an¬†excellent framework for developing Java applications because it allows developers¬†to be very productive. Today,¬†I am very excited to publish¬†my first YouTube video¬†series on this topic.¬†Spring Boot 101 is a tutorial that will show you how to use the Spring Boot framework to boost your productivity, create complex¬†applications with ease and eliminate most… Continue reading