Skip to content

@RequestMapping inheritance not worked as expect with a dot path [SPR-10554] #15185

@spring-projects-issues

Description

@spring-projects-issues

feidong opened SPR-10554 and commented


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/1.0")
public class HomeController {

    @RequestMapping(value = "/test")
    @ResponseBody
    public String home() {
        return "home";
    }

}

When start,the log is:

INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/1.0],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.github.kdlan.HomeController.home()

request with path "/1.0/test" will return 404

But when I remove the @RequestMapping on the class, and modify the method @RequestMapping with value "/1.0/test" , it works as expect

Java: 1.6.0_45
OS: OS X 10.8.3


Affects: 3.2.2

Issue Links:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions