Utilize start.spring.io to generate project structures, selecting the "Web" starter for immediate coding. Configure the spring-boot-starter-webmvc dependency in build.gradle to automatically include Tomcat and Spring MVC. Establish the standard source directory src/main/java, creating packages like com.example for files such as MyApplication.java. Annotate the main class with @SpringBootApplication, a meta-annotation combining @SpringBootConfiguration, @EnableAutoConfiguration, and @ComponentScan. Use @EnableAutoConfiguration to allow Spring Boot to guess configuration based on added JAR dependencies. Implement @RestController as a stereotype annotation for web controllers and @RequestMapping to map HTTP requests, such as the / path, to specific methods. The @RestController ensures resulting strings render directly to callers. Run the application using SpringApplication.run(MyApplication.class, args) in Java or runApplication<MyApplication>(*args) in Kotlin. Scope: Spring Boot. Reviewed October 4, 2026.
Building a first application
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- docs.spring.io
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.