Category Archives: Spring Framework

Spring @Autowired Annotation With Constructor Injection Example

In this post, We will learn about the Spring @Autowired Annotation With Constructor Injection Example using a Demo Project. Spring Dependency Injection The dependency Injection is a fundamental aspect of the Spring framework through which the Spring framework container injects objects or instances into other objects or “dependencies”. In another word, We can say that dependency Injection… Read More »

Spring @Autowired Annotation With Setter Injection Example

In this post, We will learn about the Spring @Autowired Annotation With Setter Injection Example using a Demo Project. Spring Dependency Injection The dependency Injection is a fundamental aspect of the Spring framework through which the Spring framework container injects objects or instances into other objects or “dependencies”. In another word, We can say that dependency Injection… Read More »

Spring Framework @Qualifier example

In this post, We will learn about the Spring Framework @Qualifier example using a Demo Project. The @Qualifier annotation is used to resolve the auto wiring conflict when there are multiple beans of the same type. The @Qualifierannotation can be used within the class before any class property. This annotation may also be applied to constructor arguments or… Read More »

Spring Inner bean example

In this post, We will learn about the Spring Inner bean example using a Demo Project. In the Spring framework, whenever a bean is used for only one particular property, it’s advised to declare it as an inner bean. Usually, the Spring inner bean is supported by both setter injection ‘property‘ and constructor injection ‘constructor-arg‘.… Read More »

Spring Dependency Injection with Factory Method

In this post, We will learn about Spring Dependency Injection with Factory Method using a Demo Project. Spring Dependency Injection with Factory Method: In the Spring framework, if you want to create a bean by invoking a static factory-method, whose purpose is to encapsulate the object-creation process in a static method then you may use… Read More »

Spring Constructor based Dependency Injection Example

In this post, We will learn about Spring Constructor-based Dependency Injection Example with a Demo Project. Spring Dependency Injection The dependency Injection is a fundamental aspect of the Spring framework through which the Spring framework container injects objects or instances into other objects or “dependencies”. In another word, We can say that dependency Injection promotes loose coupling… Read More »

Spring Setter Dependency Injection Example

In this post, We will learn about Spring Setter Dependency Injection Example with a Demo Project. Spring Dependency Injection The dependency Injection is a fundamental aspect of the Spring framework through which the Spring framework container injects objects or instances into other objects or “dependencies”. In another word, We can say that dependency Injection promotes loose coupling… Read More »

Spring Java-based Configuration Example

In this post, We will learn about Spring Java-based Configuration Example with a Demo Project So far We have learned, How we can configure Spring beans using XML configuration files. If you are very much comfortable with XML configuration, then it is really not required to learn how to achieve the same result with Java-based configuration.… Read More »

Annotation based Configuration in Spring Framework Example

In this post, We will learn about Annotation-based Configuration in Spring Framework with an Example In Spring Framework,  We can use an annotation-based configuration instead of using XML config for defining the beans wiring, We have an option to move the beans configuration into component class. This can be done by using annotations on the component… Read More »

Spring ApplicationContext Container Example

The Spring IOC container Spring IOC container is mainly responsible for instantiating, configuring, and assembling the Spring beans. The Spring container gets instructions on what are objects to instantiate, configure, and assemble by reading configurational metadata. The configurational metadata is represented in XML config file or Java annotations Spring framework provides the following two types of… Read More »