rest - Ambiguous handler methods mapped for HTTP path -
i have 2 methods clashing
1. @requestmapping(value = { "/{name}" }, method = requestmethod.get) void foo1(@pathvariable("name") final string name) 2. @requestmapping(value = { "/{email}" }, method = requestmethod.get) void gettemplateversionsbysenderforclient(@pathvariable("email") final string email, @requestparam(value = "timestamp", required = true) final long timestamp)
how avoid this?
you can change uri templates else. can change "email" uri template use regular expression, path looks email address processed second method. see http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html, under "uri template patterns regular expressions":
@requestmapping("/spring-web/{symbolicname:[a-z-]+}-{version:\\d\\.\\d\\.\\d}{extension:\\.[a-z]+}") public void handle(@pathvariable string version, @pathvariable string extension) { // ... }
Comments
Post a Comment