Spring Boot Concepts
Objectives
◆ What is Spring Boot?
◆ Spring Version History
◆ Key features of Spring Boot
◆ Developing Your First Spring Boot Application
2
Spring Boot
3
What is Spring Boot ?
◆ Spring Boot is a powerful framework built on top of the Spring Framework that
simplifies the development of Spring applications. It aims to reduce boilerplate
code, configuration, and setup time, allowing developers to focus on building
the core functionality of their applications.
4
Spring Version History
Spring Boot Version Release Date Spring framework version
1.0.0.RELEASE
Apr 2014 4.0.3
1.5.x Jan 2017 - Aug 2019 4.3.6 - 4.3.25
2.0.0.RELEASE Mar 2018 5.0.4
2.7.x May 2022 - Aug 2023 5.3.20 - 5.3.29
3.0.0 Nov 2022 6.0.2
3.0.x 6.0.2 - 6.0.11
3.1.x May 2023 - Now
3.2.0 Nov 23, 2023 6.1
3.3.5 Oct 24, 2024 6.1.14
3.4.0 Nov 21, 2024
5
Spring Features
Autoconfiguration: Spring Boot automatically configures your application
based on the dependencies you include in your project.
Data Access: Seamless integration with various data sources like relational
databases, NoSQL databases, and JPA.
Stand-alone Applications: Spring Boot allows you to create standalone
applications that can be run directly without the need for external servers.
Embedded Servers: Spring Boot includes embedded servers like Tomcat or
Netty, so you can run your application without deploying it to a separate server.
Starter POMs: Spring Boot provides starter POMs that simplify dependency
management. You can easily include the necessary dependencies for specific
functionalities, such as web development, database access, or security.
6
Benefits of Using Spring Boot
Rapid Application Development: Quickly create and deploy applications.
Simplified Configuration: Reduce boilerplate configuration.
Embedded Servers: No need for external servers.
Production-Ready Features: Built-in features for monitoring, metrics, and
security.
Strong Community and Ecosystem: Large community and extensive
documentation.
Simplified deployment: Package your applications as standalone JAR
files or WAR files for easy deployment.
Cloud-native support: Seamless integration with cloud platforms like
AWS, Azure, and GCP.
7
Spring Boot Components
8
Spring Boot Components
◆ Spring Boot: This is the core of the framework. It provides the SpringApplication
class (for creating standalone applications), support for embedded web servers
(like Tomcat), and externalized configurations (like database connection details).
Think of it as the foundation upon which the other components build.
◆ Spring Boot CLI Component: This is a developer-friendly command-line tool
(CLI) that compiles and runs Groovy code. It can also watch for file changes and
restart the application automatically, which makes prototyping Spring applications
quicker and easier.
◆ Spring Boot Test Component: This enables the use of annotations and
methods to write test cases for the Spring Boot application.
9
Spring Boot Components
◆ Spring Boot DevTools Component: This provides an additional toolkit aimed at
improving the development experience. Features include automatic restart upon
code changes and LiveReload to refresh the browser when HTML changes.
◆ Spring Boot Autoconfiguration Component: Autoconfiguration automatically
configures the bare minimum components needed for a Spring application based on
classpath JAR files and properties. It makes educated guesses to configure Spring
beans based on the presence of dependencies.
◆ Spring Boot Actuator Component: This provides actuator endpoints to interact
with, monitor, and audit a Spring Boot application. These endpoints offer health
checks, thread dumps, and other useful metrics to manage the application in
production.
10
Spring Boot
Programming Demo
Key Points
◆ Step 01 : Create webapp in the src/main/webapp directory and its
importance for JSP files.
12
Key Points
◆ Step 02: Config application.properties for JSP
◆ Step 03 : Config the pom.xml
13
Key Points
◆ Step 03 : Config the pom.xml
14
Open IntelliJ, File | New | Maven Project
15
Add Dependences
16
Create the Structure Project
17
Edit pom.xml
18
Edit pom.xml
19
Edit pom.xml
20
Create the Student.java in pojo
21
Create the Student.java in pojo
22
Create views : home.jsp
23
Create views : home.jsp
24
Create views : home.jsp
25
Create views : create.jsp
26
Create views : create.jsp
27
Create views : create.jsp
28
Create the HomeController.java
29
Create the HomeController.java
30
Edit SpringBoot Main
31
Edit the application.properties
32
Run Program
33
Result
34
Summary
Concepts were introduced:
◆ Spring Boot
◆ Advantages of using Spring Boot
◆ Key features of Spring Boot
Demo Spring Boot with Collections
35