Tagged “devops”

  1. Spring Boot 4: Brief Upgrade Guide and Code Comparison

    ~ cat post <<

    Spring Boot 4 vs. 3: Brief Upgrade Guide and Code Comparison

    If you’ve been following my blog, you know I love a good migration story. Whether it’s moving to TanStack Start or refining shadcn/ui forms, the goal is always the same: better developer experience and more robust code.

    Today, we’re looking at the big one. Spring Boot 4.0 is officially out, and it’s arguably the most important release since 3.0. It moves the baseline to &Java 17 (with a massive push for Java 25), adopts Jakarta EE 11, and introduces features that finally kill off years of boilerplate.

    Let’s look at exactly what changed and how your code will look before and after the upgrade.

    1. Native API Versioning

    For years, versioning an API in Spring meant custom URL paths, header filters, or complex RequestCondition hacks. Spring Boot 4 brings this into the core framework.

    The Spring Boot 3 Way (Manual Pathing)

    // You had to manually manage the path segments
    @RestController
    @RequestMapping("/api/v1/orders")
    public class OrderControllerV1 { ... }
    
    @RestController
    @RequestMapping("/api/v2/orders")
    public class OrderControllerV2 { ... }
    

    The Spring Boot 4 Way (Native Mapping)

    Now, versioning is a first-class citizen. You can keep the path clean and let Spring handle the routing logic via headers, query params, or path segments.

~ <<

See all tags .