Spring is a lightweight framework was written by Rod Johnson and was released under the Apache 2.0 license in June 2003. Spring framework is an open source framework which enables the Java developers to build robust application with ease, it has some popular concepts such as Inversion of Control / Dependency Injection and Autowiring. It even provides support for Struts, Hibernate, JSF, EJB etc.
Spring Basics
Spring Hello World
In this example, we will learn how to create a simple hello world example in Spring 3.0.
Spring XML Configuration Example
In this example, we will be creating a simple spring application using the spring xml configurations.
Spring JavaConfig
Since Spring 3.o, a developer can add all the configuration into Java class rather than into XML file.
Spring @Import annotation – JavaConfig
In spring, we will split a large XML configuration files into one or more smaller XML files for maintainability and we will finally import it in a common configuration file. @Import annotation does the same functionality for JavaConfig in Spring 3.
Spring Bean Scopes
In this article, we will learn about the different types of the bean scopes which is available in Spring
Lazy initialize Spring beans
In this article, we will learn how to learn to lazy initialize Spring bean using Bean Factory.
Instantiate Spring IoC Container
Bean factory is the more basic implementation of Spring IoC Container. Application context is the more advanced implementation. Both IoC containers will be having the same Bean configurations only.
Configure Beans in the Spring IoC Container
In this article, we will learn How to Create and Configure Beans in the Spring IoC Container
Spring Bean Reference and Spring Inner Bean
In order to refer another bean then we have to use <ref> tag, in this article we will learn how to use it.
Create Spring Beans Using Spring FactoryBean
A factory bean in Spring serves as a factory for creating other beans within the Spring IoC container.
Spring Bean Life Cycle – Bean Initialization and Destruction
In this article, we will learn about the Spring Bean Life Cycle (Bean Initialization and Destruction)
Spring Bean Creation – Static Factory Method & Instance Factory Method
In Spring we can create bean using Spring FactoryBean, FactoryBean is an interface and we need to give implementations for the methods in it. If you don’t want to go by that methodology but still want Java Factory Pattern to be implemented then we can go for Static Factory Method and Instance Factory Method.
Dependency Injection in Spring
What is Dependency Injection
Dependency Injection(DI) or Inversion of Control(IoC) is the prominent feature of Spring Framework. Dependency Injection is a design pattern which removes the dependency between objects so that our code becomes loosely coupled
Spring Dependency Injection – Setter Injection
In this article, we will look at how the Setter Injection Works.
Spring Dependency Injection – Constructor Injection
We will learn how to perform Constructor Injection (<constructor-arg>) in Spring.
Setter Injection With Primitives
In this article, we will look at how the Setter Injection Works with primitive datatypes.
Setter Injection With Objects
In this article, we will look at how the Setter Injection Works with objects.
Dependency Injection With List Collection Example
Dependency Injection of List
Dependency Injection With Set Collection Example
Dependency Injection of Set
Dependency Injection With Map Collection Example
Dependency Injection of Map
Dependency Injection With Properties Example
Dependency Injection of Properties
Spring Difference between Setter and Constructor Injection
In this article, let’s understand the difference between Setter and Constructor Injection.
Spring Constructor Injection – Resolving Ambiguity
In this article, we will learn how to resolve ambiguity which occurs when we have the one or more matching constructors.
Autowiring in Spring
What is Autowiring
Autowiring is a feature of Spring framework which lets you to Inject Dependency implicitly
Spring Autowiring byName
In this article, we will learn about Autowiring byName
Spring Autowiring byType
In this article, we will learn about Autowiring byType
Spring Autowiring constructor
In this article, we will learn about Autowiring constructor
Spring @Required Annotation
Through Setter Injection we cannot make sure that values for all the properties have been injected in those cases @Requred annotation will help us manage the dependency
Spring Autowiring Annotations – @Autowired, @Resource, @Qualifier, @Inject Annotation
In this article, we will learn about how to use @Autowired, @Resource, @Qualifier, @Inject Annotation
Database
Spring Data JPA One To One Foreign Key Example
In this Spring Data JPA One To One article, we will learn how to achieve One To One Mapping using Spring Data JPA.
Spring Data JPA One To Many Foreign Key Example
In this Spring Data JPA One To Many article, we will learn how to achieve One To Many Mapping using Spring Data JPA
Spring Data JPA Many To Many Foreign Key Example
In this Spring Data JPA One To Many article, we will learn how to achieveData JPA Many to Many mapping using Spring Data JPA
Spring JdbcTemplate Example – JdbcDaoSupport
In this Spring JdbcTemplate Example, let’s understand how JdbcTemplate eases the development effort.
Spring CRUD Example with JdbcTemplate
In this Spring CRUD Example, we will build a Simple Spring Application and perform CRUD operations using Spring JdbcTemplate.
Misc
Spring PropertyPlaceholderConfigurer Example
Spring comes with a bean factory post-processor called PropertyPlaceholderConfigurer which allows you to externalize those all the hard coded values into a properties file.
ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
Spring MVC throws this exception when it is not able to find the “org.springframework.web.context.ContextLoaderListener” class which loads up the all the Spring MVC configuration files and other configuration files which is declared in the web.xml.