In this article, we will learn about Many-to-Many relationships in JPA and how to implement them in a Spring Boot application. Let’s get started! @ManytoMany annotation A many-to-many relationship occurs when multiple records in one table are associated with multiple records in another table. The @ManyToMany annotation is used to define a many-valued association with…
Read More Many-to-Many Relationship in Spring Boot Rest with JPA
Dependency Injection is a design pattern that allows the separation of concerns in an application by removing the hard-coded dependencies between objects. In Dependency Injection, the objects are provided with their dependencies instead of having to hard-code them. This makes the application more flexible, maintainable, and easier to test. Spring Framework provides several ways to…
Read More Field-based Dependency Injection in Spring
Spring Boot offers various methods and techniques for setting up your database. It can automatically create and initialize the database using the information in the data source. Spring Boot looks for SQL files in specific locations in your project’s classpath, such as “schema.sql” and “data.sql”. In this tutorial, you will learn how to configure your…
Read More Database Initialization with Spring Boot
Spring Framework is a popular Java-based framework that provides a comprehensive infrastructure for developing Java applications. The framework was initially released in 2002 by Rod Johnson, who was frustrated with the complexity of the existing Java EE (Enterprise Edition) platform. He wanted to create a simpler and more lightweight framework that would make it easier…
Read More Excel in Spring Framework: The Complete Guide
This tutorial will teach you how to implement Role-based access control in the new Spring Authorization Server. You will learn how to add a user role to a JWT token issued by Spring Authorization Server and configure Spring Resource Server to secure access to the API endpoint based on a user role. 1. Create, Run…
Read More Role-based Access Control in Spring Authorization Server
This tutorial will teach you how to migrate from the depricated WebSecurityConfigurerAdapter towards the content-based security configuration. Spring Security allowed customizing HTTP security by extending a WebSecurityConfigurerAdapter class. This customization included user authorization, user authentication, etc. But in Spring Security 5.7.0-M2 the WebSecurityConfigurerAdapter is deprecated. This is because Spring Framework developers encourage users to move…
Read More (Solved!) Deprecated WebSecurityConfigurerAdapter
In this article, we will cover the basics of Aspect-Oriented Programming (AOP). You will learn how to use AspectJ to provide different AOP advices to Spring Boot applications to support cross-cutting issues like logging, profiling, caching, and transaction management and finally we will do a practical implementation to record user operations using Spring Boot AOP.…
Read More A guide to Spring Boot AOP to Record User Operations
In this tutorial, you will learn how to create and configure the new Spring OAuth Authorization Server. Video Demonstration To demonstrate how to configure and use the new Spring Authorization Server, I have created a series of step-by-step video lessons. You can access these video lessons by enrolling in my video course called “OAuth 2.0…
Read More Spring Authorization Server Tutorial
Spring Web MVC – Overview for Beginners (Includes video tutorial) Configure JSP Support (Includes video tutorial) Configure Thymeleaf Support (Includes video tutorial) The Model Object (Includes video tutorial) The ModelMap Object (Includes video tutorial) The ModelAndView Object (Includes video tutorial) Reading URI Path Variables (Includes video tutorial) Reading URL Query String Parameters (Includes video tutorial) Read Form Data in Spring Web MVC…
Read More Spring Web MVC Tutorials
In this tutorial, we are going to see how to insert records into a DynamoDB table using an AWS Lambda function written using Spring Boot Java. We are also going to add an AWS API Gateway trigger to the Lambda function and see how it works. To follow this tutorial, make sure that you have…
Read More Writing into DynamoDB in a Spring Boot App using AWS Lambda
In the previous blog post, we have covered how to grant access to certain endpoints based on the Role configured through code. As we know, Keycloak is the Identity and Access Management solution that provides out-of-the-box authentication and authorization services. One of the services includes a Fine-Grained Authorization Service. Fine-Grained Authorization Service provides businesses with…
Read More Fine-grained Authorization Services in Keycloak with Spring Boot
In this tutorial, you will learn about Spring Boot Actuator. You will also see how it helps to monitor and manage your application seamlessly. Overview The actuator is a monitoring function provided by the Spring Boot framework. The actuator works by exposing endpoints that can be used to monitor the internal conditions of the Spring…
Read More Spring Boot Actuator Tutorial
In the previous tutorial, we learned that how we can do User Authentication with Amazon Cognito in Spring Boot Application. In this tutorial, we will take our previous learnings and continue with the following. Create Rest Controller to handle /login HTTP POST requests. Read username and password from the request body to authenticate with Amazon Cognito…
Read More Amazon Cognito User Authentication in Spring Boot REST
Spring Boot is a popular framework for building Java-based web applications. It provides a simple and efficient way to build, deploy and run Java applications quickly. In this tutorial, we’ll explore the framework’s basics, including its features, advantages over the Spring Framework, and how to get started with creating your first application using it. Whether…
Read More Spring Boot: Getting Started Guide
This tutorial will teach you how to use Keycloak to secure your Spring Boot Application. To find other tutorials, check the Keycloak tutorials page. What is Keycloak? According to Keycloak’s official website, It is an open-source Identity and Access Management solution aimed at modern applications and services. It makes it easy to secure applications and…
Read More A Guide to use Keycloak with Spring Boot