Spring Boot Course

Course Fee: ₹2000.0


Spring Boot Overview

Spring Boot

Spring Boot is an approach to develop Spring-based applications with minimal configurations. It simplifies the process of setting up and deploying Spring applications by offering auto-configuration, embedded servers, and production-ready features.

Types of Applications You Can Develop with Spring Boot:

  • Standalone applications
  • Web applications
  • Distributed systems (Web services)

Advantages of Spring Boot:

  • Starter POM - Simplifies Maven/Gradle build configuration:
    • web-starter
    • datajpa-starter
    • security-starter
    • mail-starter
  • Auto Configuration - Automatically detects the necessary configurations for the application:
    • Creating DB connection pool
    • Deploy web apps on embedded servers
    • Start IOC container
    • Component scanning
  • Actuators - Monitor and manage the application:
    • How many beans are loaded?
    • How many URL patterns are mapped?
    • Configuration properties loaded?
    • Application health status
    • Heap dump
    • Thread dump
  • Embedded Servers - Provides embedded servers to run Spring Boot applications:
    • Apache Tomcat (default)
    • Jetty
    • Netty

Creating a Spring Boot Application:

  • Initializr Website - Use the Spring Initializr to create a Spring Boot project easily.
  • IDE - IDEs like IntelliJ, Eclipse, or Spring Tool Suite connect to Spring Initializr internally to create Spring Boot projects.

Spring Boot =

Spring (XML configurations) + Auto Configuration + Embedded Servers + Actuators

What is the Start Class in Spring Boot?

The start class is the entry point for boot application execution. It is also known as the main class in Spring Boot.

@SpringBootApplication is equivalent to the following three annotations:

  • @SpringBootConfiguration @Configuration
  • @EnableAutoConfiguration
  • @ComponentScan

How does IOC Start in Spring Boot?

The IOC container is started through the SpringApplication.run() method.

  • boot-starter: AnnotationConfigApplicationContext
  • web-starter: AnnotationConfigServletWebServerApplicationContext
  • starter-webflux: AnnotationConfigReactiveWebServerApplicationContext

What is Banner in Spring Boot?

The Spring logo that appears in the console when you start a Spring Boot application is called the "banner."

There are three banner modes:

  • console (default): Prints on the console
  • log: Prints in the log file
  • off: Doesn't print the banner

You can configure the banner mode in application.properties:

spring.main.banner-mode=off