Spring Boot extends the Spring Framework to make applications quicker to set up. Its starter dependencies collect related libraries, while autoconfiguration uses the classpath, environment properties, and other clues to configure components. That leaves less Java or XML configuration to write by hand. section 1.1 section 1.5
To start a web application:
- Generate a project with Spring Initializr, directly or through Spring Tool Suite. Choose a Spring Boot version and the dependencies the application needs. section 1.2.1
- Put application code under src/main/java and tests under src/test/java. Use application.properties for configuration properties; place browser assets in static and view templates in templates. section 1.2.2
- Launch the generated main class. Its @SpringBootApplication annotation identifies the bootstrapping class, and its main method calls SpringApplication.run(...). section 1.2.2
Listing 1.2 The Taco Cloud bootstrap class
package tacos;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication #1
public class TacoCloudApplication {
public static void main(String[] args) {
SpringApplication.run(TacoCloudApplication.class, args); #2
}
}
The generated bootstrap class shows how little launch code is needed: an annotated class with a main method that runs the application. section 1.2.2
A web page without server setup
Add the Web and Thymeleaf starters to a web application. They bring in Spring MVC, an embedded Tomcat server, and Thymeleaf. At startup, autoconfiguration sets up the MVC beans, server, and view resolver. Run the application in Spring Tool Suite or with ./mvnw spring-boot:run, then open http://localhost:8080. Tomcat is part of the application; you did not deploy the application to a separate server. section 1.3.6 section 1.3.4 section 1.2.2
A generated @SpringBootTest can check that the application context loads. For deployment, package the application as an executable JAR, a WAR for a traditional Java application server, or a container image. Spring Boot also provides runtime insights through Actuator and additional testing support. section 1.2.2 section 18.1 section 1.4.2



