See spring-projects/spring-boot#33499 for initial report. It looks like the enhancement in #29625 was incomplete.

The goal was to make the following work for both http://localhost:8080 and http://localhost:8080/:

@RestController
public class HomeController {

    @GetMapping
    public String home() {
        return "Hello, World!";
    }

}

But this use case doesn't work still, as the fix was focusing on the combining of @RequestMapping annotations. In the code snippet above, org.springframework.web.servlet.mvc.condition.PathPatternsRequestCondition#combine is never called as org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#getMappingForMethod will only call it if the RequestMappingInfo is available on the type. Here, it's null so the combination never happens.

29625 did change the following, when the controller type itself is annotated with @RequestMapping.

@RestController
@RequestMapping
public class HomeController {

    @GetMapping
    public String home() {
        return "Hello, World!";
    }

}

Comment From: BrijeshPatra

if you want a method annotated with @RequestMapping to match both "" (empty path) and "/" (root path), you can specify both values in the value or path attribute of the annotation, separated by a comma. For example:

@RequestMapping(value = {"", "/"}, method = RequestMethod.GET) public String myMethod() { // method implementation } In the above example, the myMethod method will handle requests to both the empty path and the root path.

Comment From: bclozel

@BrijeshPatra thanks but this is not a question, but rather a behavior change that the team wants to make.

Comment From: BrijeshPatra

Oh okay! Thanks for your reply actually i want to contribute in this project can you please guide me here. @bclozel