Category: java
What is Spring Boot Architecture?
Published on 24 Jul 2026
Explanation
Spring Boot architecture provides a streamlined way to build Java applications. It combines Spring Framework features with auto-configuration, starter dependencies, embedded servers, and production-ready tools, allowing developers to create standalone applications with minimal configuration.
Code:
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
Explanation
The @SpringBootApplication annotation is the entry point of a Spring Boot application. It combines @Configuration, @EnableAutoConfiguration, and @ComponentScan, enabling configuration, automatic bean creation, and package scanning with a single annotation.
Code:
@SpringBootApplication
public class Application {
}
Explanation
When a client sends an HTTP request, the embedded Tomcat server forwards it to the DispatcherServlet. The DispatcherServlet identifies the appropriate controller, invokes the service and repository layers, and returns the response to the client.
Code:
Client ↓ Embedded Tomcat ↓ DispatcherServlet ↓ Controller ↓ Service ↓ Repository ↓ Database
Explanation
During application startup, Spring Boot creates an ApplicationContext that manages all Spring Beans. Controllers, Services, Repositories, and Configuration classes are registered automatically and injected wherever required using Dependency Injection.
Code:
ApplicationContext context =
SpringApplication.run(Application.class, args);
StudentService service =
context.getBean(StudentService.class);
Explanation
Spring Boot includes an embedded web server such as Tomcat, Jetty, or Undertow. This allows applications to run directly as executable JAR files without deploying them to an external application server.
Code:
server.port=8080 # Supported Servers Tomcat Jetty Undertow