Skip to content

Docs should warn against split URL handling across handler mappings #24304

Closed
@xiaoqiang0-0

Description

@xiaoqiang0-0

Affects: <5.1.9.RELEASE>


This issue should also exist in older versions!

At the same time, through the custom controller and implement org.springframework.web.servlet.config.annotation.WebMvcConfigurer#addViewControllers to register the mapping of different methods with the url, a 405 error will occur.

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/foo").setViewName("foo");
    }
    @PostMapping("/foo")
    public ResponseEntity<?> foo() {
        return ResponseEntity.ok("Success!");
    }

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions