Closed
Description
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!");
}