Web Dev Academy Backend frameworks · Spring Tool 45 / 64
Backend frameworks

Spring

The backbone of enterprise Java. Spring Boot makes Java web apps approachable with auto-configuration, dependency injection, REST controllers and Spring Data JPA — production-grade out of the box.

Demo 01

Spring Initializr — build a project

Every Spring app starts at start.spring.io. Pick your dependencies, click generate, and watch the project skeleton stream in.

Dependencies:
    Demo 02

    A @RestController returns JSON

    Annotations do the heavy lifting. @RestController + @GetMapping map an HTTP request to a Java method. Send a request and see the simulated response.

    Endpoints: /api/products, /api/products/{id}, /api/health
    @RestController
    @RequestMapping("/api/products")
    public class ProductController {
    
        private final ProductRepository repo;
    
        @GetMapping
        public List<Product> all() {
            return repo.findAll();
        }
    
        @GetMapping("/{id}")
        public Product one(@PathVariable Long id) {
            return repo.findById(id).orElseThrow();
        }
    }
    Demo 03

    Spring Data JPA repositories

    Declare an interface method name and Spring writes the query for you. Pick a repository method and see the result table + the SQL Spring generates.

    public interface ProductRepository
            extends JpaRepository<Product, Long> {
    
        List<Product> findByInStockTrue();
        List<Product> findByPriceLessThan(double price);
    }
    Demo 04

    Dependency injection in action

    Spring's IoC container creates and wires your objects (beans). You never call new for a service — you ask for it, Spring supplies it. Watch the container boot.

    // startup log appears here…
    Demo 05

    Why Spring?

    The default choice for serious Java backends.

  • Auto-configuration — Spring Boot wires sensible defaults so you write almost no setup.
  • Dependency injection — loosely-coupled, testable components via the IoC container.
  • Vast ecosystem — Security, Data, Cloud, Batch, Kafka — one consistent programming model.
  • Battle-tested — runs huge portions of the enterprise & banking world.
  • i
    The Initializr generator, REST endpoint console, JPA repository table and DI boot log are simulated with vanilla JavaScript — real Spring runs Java on a JVM server (embedded Tomcat) with a real database. The code blocks show genuine Java/Spring Boot syntax. The shared CSS shell provides page styling.

    ↑ All 64 tools