MongoCollection in Spring Boot

In this post, we will learn to use a MongoCollection instance for database operations in the Spring Boot application. We all know that we have a spring boot data repository for MongoDB which has an interface MongoRepository and a class … Read More

Set Environment Variable in Tomcat

In this post, we will learn to set environment variables in the tomcat configuration file so that when the application loads then it will pick a value automatically from there. Example: Let’s say, we have a Spring Boot application packaged … Read More

Logging MongoDB Queries in Java?

In this post, we will learn to enable logging MongoDB queries in Java. For this example, we need a MongoDB driver for Java. To display the query in the log we need to set the org.mongodb.driver level to debug.

Spring Boot Circular Dependency Error

What is a circular dependency? The circular dependency error occurs when a bean type A is dependent on B and B is also dependent on A. Example: BeanA -> BeanB -> BeanA BeanA BeanB How does Spring create a Bean? … Read More

Multipart File Upload Spring Boot

In this post, we will learn to upload a Multipart File using Spring Boot. If you want to learn how to implement it in angular then you can visit upload multipart file in angular. Let’s see an example code that … Read More

Pagination and Sorting Spring Data JPA

1. What is Pagination and Sorting? Pagination is the process of splitting the content into small chunks from the large data set. Sorting is a mechanism to arrange the data either ascending or descending by a given field. The ascending … Read More

Create Spring Boot project using Spring Initialzer

In this post, we will learn to create a Spring Boot project using Spring Initializer. Spring initializer is a simple web page that helps us to generate a spring boot project along with the required structure. Create Spring Boot Project … Read More

Disable Spring Security for Specific Profile

Overview In this post, we will learn to disable spring security for a specific profile and enable it for others. Let’s say, we have two profiles dev and prod in our spring boot application and we want to disable security … Read More