Spring Boot Fundamentals
Spring Boot Fundamentals
Dependency Injection
Spring beans
Exception Handling
Validations
Transaction Management
Spring Boot
Externalized Con guration
What is a Problem?
Basically, Spring-based applications have a lot of con gurations
For example
When we develop Spring MVC web application using Spring MVC then we need to con gure:
Component scan, Dispatcher Servlet, View resolver, Web jars(for delivering static content) among
other things
When we use Hibernate/JPA in the same Spring MVC application then we would need to con gure a
Data source, Entity manager factory/session factory, Transaction manager among other things.
When you use cache, message queue, NoSQL in the same Spring MVC application then we need to
con gure
Cache con guration
Message queue con guration
NoSQL database con guratio
One more major problem - We need to maintain all integration of different Jar dependencies and it’s
compatible versions
Ramesh Fadatare ( Java Guides)
fi
:
fi
.
fi
fi
fi
.
fi
fi
What is a Solution
> Spring Boot is the solutio
> Spring Boot automatically con gures the
con gurations based on the jar dependencies that we
add to our project
fi
Create Your First Spring
Boot App
By Ramesh Fadatare (Java Guides)
Understanding Spring Boot App
Structur
(Important les and folders)
By Ramesh Fadatare (Java Guides)
e
fi
Spring Boot Starter
Feature
By Ramesh Fadatare (Java Guides)
Problem
Spring MVC
Hibernate
Spring Security
Solution - spring-boot-starter-web
Spring MVC
fi
fi
s
Problem
Basically, Spring-based applications have a lot of con gurations
For example
1. When we develop Spring MVC web application using Spring MVC then
we need to con gure:
fi
fi
.
fi
.
Solution
When we add Spring MVC Jar dependency to our application then can
we automatically con gure some Spring beans related to Spring MVC
Ex: Dispatcher Servlet, View resolver
When we add Hibernate Jar dependency to our application then can
we automatically con gure Spring beans related to Hibernate
Ex: Data source, Entity manager factory/session factory, Transaction
manager
fi
fi
Spring Boot Auto Configuration in an Action
-> Spring boot auto con guration is implemented in spring-boot-
autocon gure.ja
-> Example of Spring MVC
fi
:
fi
fi
fi
fi
)