Spring Boot

In this tutorial, you will learn how to generate a custom JSON Web Token(JWT) and how to add and validate custom JWT Claims using the io.jsonwebtoken library. The JWT token generated in this tutorial will be signed with a SecretKey, making it secure and tamper-proof. Also, this tutorial assumes you have prior knowledge of creating…

Read More Generate JWT. Add and Validate Custom Claims.

In this tutorial, you will learn what the @Respository annotation is and how to use it in your Spring Boot applications. @Repository is a Spring annotation that indicates that the decorated class is a repository. A repository is a mechanism for encapsulating storage, retrieval, and search behaviour which emulates a collection of objects. How to…

Read More @Repository Annotation in Spring

@Component is a Spring annotation that is used to indicate that a class is a component. Components are objects that make up the structure of an application and are responsible for performing specific tasks. They are typically used to represent services, controllers, repositories, and other types of objects that are used to implement business logic…

Read More @Component Annotation in Spring

In this tutorial, you will learn about the difference between two Spring Boot dependencies – Spring Boot Actuator and Spring Boot Starter Actuator. If you’re new to Spring Boot, these terms may sound confusing, but don’t worry, by the end of this tutorial, you’ll understand the difference between them. Spring Boot is a popular framework…

Read More Spring Boot Actuator vs Spring Boot Starter Actuator

Spring Boot Actuator is a useful feature that provides developers with a set of tools to monitor and manage their applications. However, some of the actuator endpoints are sensitive and can potentially expose sensitive information about your application. In this article, we’ll explore different ways to secure these endpoints to ensure your application is protected.…

Read More Securing Spring Boot Actuator Endpoints: Best Practices

In this tutorial, I will explain in detail how to secure sensitive Spring Boot Actuator Endpoints using Spring Boot version 3. This tutorial is intended for beginners who want to learn how to monitor and manage their Spring Boot applications using Actuator. Spring Boot Actuator is a sub-module of Spring Boot that provides production-ready features…

Read More How to Secure Spring Boot Actuator Endpoints with Basic Authentication

In this tutorial, you will learn how to enable OpenAPI(Swagger) in your Spring Boot version 3 application. What is OpenAPI? OpenAPI (formerly known as Swagger) is a specification for building and documenting RESTful APIs. It allows developers to describe their API operations, inputs, outputs, and other aspects in a structured and machine-readable format. This documentation…

Read More Enable OpenAPI 3(Swagger) in Spring Boot 3

This tutorial covers three distinct methods for reading application properties in a Spring Boot application. These methods include: Using the Environment object. Using the @ConfigurationProperties annotation. Using the @Value annotation. I made a simple Spring Boot Web App to show you how to read application properties. You can use the tutorial Create a Simple Web…

Read More Spring Boot: Reading Application Properties

In this blog post, I will share the Spring annotations used to map HTTP requests to specific handler methods. These annotations include @PostMapping, @GetMapping, @PutMapping, and @DeleteMapping. While most Spring Boot applications use the @RequestMapping annotation, which I will also cover in this post, I’ll begin with the newer shortcut annotations that have been available…

Read More Spring Annotations @PostMapping, @GetMapping, @PutMapping and @DeleteMapping