In this article, we focus on exception handling for a REST API. We talk about the various techniques to implement effective error handling for the Spring Boot REST APIs. Introduction to Exception handling for REST APIs In the typical Spring Boot REST-based application, we generally expose several REST endpoints for consumers to communicate with the …
Spring Boot Thymeleaf Example
Thymeleaf is a template engine which exercises the HTML or XML file, parses it and then produces web content. The primary difference between JSP and thymeleaf is JSPs compile to Servlets. However, Thymeleaf reads the template file, parses its DOM and then applies the model to it. In this tutorial, we will take a look …
Spring Boot Security – Spring REST Security Example
In the last two articles, I have demonstrated Spring Boot REST APIs through an example. Furthermore, we have also seen how to validate bean properties using hibernate validators. Particularly In this tutorial, we will see how to add secure our REST endpoints through spring security. What is Spring Security SpringSecurity It is a part of the …
Spring Validator – Spring Boot Validation Example
In the last article, we have seen how to create a simple spring boot rest example. In this tutorial, we will take a look at the spring validator and how to create a custom validator for the bean validation. To demonstrate the validators concept in spring boot, we will take a look at a few …

Spring Boot Rest Example – Restful Webservices CRUD example
REST, or REpresentational State Transfer, is an architectural style to build applications by using APIs that allow the server to communicate with clients using the basic HTTP protocols. Why REST is popular:1. It allows the separation between the client and the server.2. It doesn’t rely on a single technology or programming language.3. You can build the …
Spring boot Swagger 2 example
Developing a REST API is hard. Not only because of the effort required to design and implementation, but also the effort required for documentation so that the developers who are going to use it have a clear understanding. Swagger is a framework that helps in the documentation of APIs. Therefore, In this tutorial, we will see how …
Spring Boot Lazy Initialization Example
Lazy Bean’s initialization is not a new topic for Spring developers. The spring framework supports lazy-init from over 10 years. By enabling lazy loading ( lazy-init=”true” ) for a bean, we tell spring container to not to create that bean until it’s needed. So, what is new in the spring boot lazy initialization feature that …
Spring @Bean – What is Spring Bean with examples
The Spring framework is a popular framework that lets you create enterprise applications conveniently. The core of the spring framework is dependency injection. Dependency injection or dependency inversion is a way in which you decouple the conventional dependencies between objects. To understand dependency injection let’s take an example of the Student and Address class. As …
Deploying Spring Boot application in Google Kubernetes
In this article, we will take a look at Kubernetes, the difference between Kubernetes and Docker, and how to deploy Spring boot application in Kubernetes. Kubernetes is an open-source container orchestration and management tool. Kubernetes can manage the container’s lifecycle. Furthermore, it can perform operations like container deployment, scaling-up & scaling-down the containers along with …
Spring Boot Profiles with examples
In this tutorial, we are going to look at spring boot profiles and what is the use of it? Profiles are the core feature of spring boot framework that provides a way to segregate parts of your application configuration and make it available only in a certain environment. It is highly useful when configuring a …