In the Javadoc comments for org.springframework.web.bind.annotation.RequestMapping#params, it is noted that:
The primary path mapping (i.e. the specified URI value) still has to uniquely identify the target handler, with parameter mappings simply expressing preconditions for invoking the handler.
Does that mean as far as Spring is concerned, these handler methods are "invalid" then, as the URI does not "uniquely identify the target handler"?
@RestController
@RequestMapping(path = "/demo1")
public class DemoController1 {
@GetMapping(params = "p=1")
public String endpoint1(@RequestParam("p") final String p) {
return p;
}
@GetMapping(params = "p=2")
public String endpoint2(@RequestParam("p") final String p) {
return p;
}
}
If that's the case, Spring should throw an error during startup or print a warning, but it doesn't.
And FWIW, requests can be routed to endpoint1/endpoint2 based on value of p so maybe the Javadoc comment is out of date?
For context, see: https://gitter.im/spring-projects/spring-boot?at=5f1ef4e6e9066820051edccd
In the Javadoc comments for
org.springframework.web.bind.annotation.RequestMapping#params, it is noted that:Does that mean as far as Spring is concerned, these handler methods are "invalid" then, as the URI does not "uniquely identify the target handler"?
If that's the case, Spring should throw an error during startup or print a warning, but it doesn't.
And FWIW, requests can be routed to
endpoint1/endpoint2based on value ofpso maybe the Javadoc comment is out of date?For context, see: https://gitter.im/spring-projects/spring-boot?at=5f1ef4e6e9066820051edccd