Spring Boot Rest Exception Handling Example

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 … Continue reading “Spring Boot Rest Exception Handling Example”

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 … Continue reading “Spring Boot Thymeleaf Example”

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 … Continue reading “Spring Boot Security – Spring REST Security Example”

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 … Continue reading “Spring Validator – Spring Boot Validation Example”

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 … Continue reading “Spring Boot Rest Example – Restful Webservices CRUD example”

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 … Continue reading “Spring boot Swagger 2 example”

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 … Continue reading “Spring Boot Lazy Initialization Example”

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 … Continue reading “Spring @Bean – What is Spring Bean with examples”

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 … Continue reading “Deploying Spring Boot application in Google Kubernetes”

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 … Continue reading “Spring Boot Profiles with examples”

For those who are not familiar with this technology, we could say that Spring Boot is a tool that was born with the purpose of further simplifying the development of applications based on the already popular Spring Core framework. Spring Boot seeks the developer only if it focuses on the development of the solution, completely forgetting about the complex configuration that Spring Core currently has in order to function.

Spring-Boot focuses its success on the following features that make it extremely easy to use:

  • Configuration: Spring-Boot has a complex module that auto-configures all aspects of our application so that you can simply run the application, without having to define anything at all.
  • Dependency resolution: With Spring Boot you just have to determine what type of project we will be using and it is responsible for solving all libraries / dependencies for the application to work.
  • Deployment: Spring-Boot can be run as a Stand-alone application, but it is also possible to run web applications, since it is possible to deploy applications through an integrated web server, such as Tomcat, Jetty or Undertow.
  • Metrics: By default, Spring Boot has services that allow you to check the health status of the application, allowing you to know if the application is on or off, memory used and available, number and detail of the Bean’s created by the application, controls for the application. on and off, etc.
  • Extensible: Spring Boot allows the creation of add-ons, which help the Free Software community create new modules that make development even easier.