Most Java backend applications are not written from scratch. They use a framework that handles routing, database connections, and configuration for you. Spring Boot is the most widely used Java framework for building web applications and REST APIs.
A minimal Spring Boot controller looks like this:
@RestController
public class HelloController {
@GetMapping("/hello")
public String hello() {
return "Hello from Spring Boot";
}
}
That is enough to create a working HTTP endpoint. Spring Boot auto-configures a web server, so you don't need to set up Tomcat or Jetty yourself. You focus on your business logic, and the framework handles the plumbing.