6 · Advanced · lesson 41 of 41
A Peek at Spring Boot
The most popular Java framework, in one file.
Java
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
@RestController
class HelloController {
@GetMapping("/hello")
String hello(@RequestParam String name) {
return "Hello, " + name;
}
}Run it and http://localhost:8080/hello?name=Ada answers 'Hello, Ada'. Spring uses annotations + reflection to wire the controller, start an embedded Tomcat, and serve HTTP.
Key takeaways
- ✓Convention over configuration — sensible defaults everywhere.
- ✓Annotation-driven: @Service, @Repository, @Autowired, @Transactional.