- 
        Couldn't load subscription status. 
- Fork 38.8k
Description
Shelley J. Baker opened SPR-10193 and commented
Update: Original request below is to raise HttpRequestMethodNotSupportedException. Actual solution raises UnsatisfiedServletRequestParameterException.
When a request is made to a URI using an unsupported method, a 404 error is returned instead of a 405 when another mapping exists for that method with matching parameters.
For example, given the following mappings:
@Controller
@RequestMapping("/test")
public class TestController {
    @RequestMapping(method = RequestMethod.GET)
    public void get() {}
    @RequestMapping(method = RequestMethod.POST, params = "test")
    public void post() {}
}
The following occurs:
POST /test
expected: 405
actual: 404
Specifically, the RequestMappingInfoHandlerMapping handleNoMatch method returns null instead of throwing the HttpRequestMethodNotSupportedException as expected.
This is a regression between 3.1.2 and 3.1.3; previously, the 405 occurred as expected. This may be related to the changes introduced by #14237.
Affects: 3.1.3
Referenced from: commits 72013f9, 3c09b07
Backported to: 3.1.4