The RouterHandlerResolver#findActionMethod() method doesn't always work if the controller has two overloaded versions of a method.
For example, it doesn't distinguish those two methods ( taken from Spring Social's org.springframework.social.connect.web.ConnectController ) :
public String connectionStatus(NativeWebRequest request, Model model)
and
public String connectionStatus(@PathVariable String providerId, NativeWebRequest request, Model model)
If my routes are :
GET /connect/{providerId}/? connectController.connectionStatus
GET /connect/? connectController.connectionStatus
and I call "/connect", the wrong method is used and I get an exception :
org.springframework.web.bind.ServletRequestBindingException: Missing URI template variable 'providerId' for method parameter type [java.lang.String]
I guess what is missing is something similar to the "best match" algorithm used by Spring. @PathVariable annotations and such should be taken in account to find the correct method.
The RouterHandlerResolver#findActionMethod() method doesn't always work if the controller has two overloaded versions of a method.
For example, it doesn't distinguish those two methods ( taken from Spring Social's org.springframework.social.connect.web.ConnectController ) :
and
If my routes are :
and I call "/connect", the wrong method is used and I get an exception :
I guess what is missing is something similar to the "best match" algorithm used by Spring. @PathVariable annotations and such should be taken in account to find the correct method.