Author: Arpit Mandliya
- 15 July
Spring boot @ConfigurationProperties
In this tutorial, we are going to see about Spring boot @ConfigurationProperties annotation. Spring boot @ConfigurationProperties allows you to map properties values with java object easily. Let’s first see the normal mapping first. Let’s say you have properties file below. application.properties [crayon-6787df0bba3d1502329267/] You can access above property file as below. [crayon-6787df0bba3dc941752921/] So, you can use @Value […]
- 09 July
Spring boot starters
In this tutorial, we are going to see about Spring boot starters. This is part of Spring boot tutorial series. Dependency management is one of the critical tasks while working on any project. You want to create a new spring project with JPA capabilities. Do you know what dependencies you need to include? You might […]
- 24 June
No qualifying bean of type in Spring or Spring Boot
In this post, we will see about an exception: No qualifying bean of type. Exceptions are least expected but you might get it while working with Spring. or Spring boot. Did you get this exception: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type? If yes, let’s see different reasons for it. Reason 1: You forgot to declare […]
- 17 June
Spring XML configuration example
In this post, we will see how to create Spring hello world XML based configuration example. Here are simple steps to create Spring XML configuration example. 1. Create a simple java maven project. 2. Maven dependency put spring and cglib maven dependency in pom.xml. [crayon-6787df0bbcbd5735982086/] So your pom.xml will look like: [crayon-6787df0bbcbdc994539152/] 3. Create Bean class […]
- 15 June
Injecting Prototype bean into a Singleton bean in Spring
In this post, we will see how to inject prototype bean scope into Singleton Instance in Spring. This is one of the most asked Spring interview questions. Problem When you inject prototype bean to singleton bean, prototype bean still behave like a singleton bean. Let’s understand this with the help of example. 1. Create a […]
- 15 June
Circular dependencies in Spring
In this post, we will discuss one of the most asked Spring interview questions. What happens if there are circular dependencies in Spring. Problem What if there are circular dependencies in Spring? For example: Class A requires an instance of Class B and Class B requires an instance of Class A. Let’s create an example […]
- 14 June
Longest Substring Without Repeating Characters
If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this tutorial, we will see Find Longest Substring Without Repeating Characters in java. Problem We need to find Longest Substring Without Repeating Characters Solution Brute force solution Find all the substring and check the Longest Substring Without […]
- 08 June
Java Regex for alphanumeric characters
In this post, we will see how to create regex alphanumeric which will create only alphanumeric characters. There are times when you need to validate the user’s input. It should contain only characters from a-z, A-Zor 0-9. Here is simple regex for it. ^[a-zA-Z0-9]*$ Here is the explaination of above regex. ^ : start of […]
- 08 June
Java – Create new file
There are many ways to create a file in java. Creating a file is a very easy task. We will learn 5 different ways to Create a file. Using java.io.File class’s createNewFile method This is simplest and oldest way to create file.Here is simple snapshot to create a file in java. [crayon-6787df0bbe572356188838/] Using java.nio.file.Files from […]