I found an interesting issue using the @RequestMapping annotations at both class-level and method-level. An ambiguous mapping exception will be thrown if there is a method which maps to empty string and also a method which maps to the same path as the class-level mapping.
Example:
@Controller
@RequestMapping("/test")
public class TestController
{
@RequestMapping("")
public void indexHandler() { }
//Should map to /test/test
@RequestMapping("/test")
public void subTestHandler() { }
}
From the logs in my test server it seems like it finds the class-level mapping when it is attempting to map the subTestHandler(); mapping. This is specific only to using the empty string mapping and also another method mapping which is the same as the class-level mapping.
Granted you could rename the method-level mapping, this doesn't seem like desired functionality.
Affects: 3.1.1
The text was updated successfully, but these errors were encountered:
Peter Lunneberg opened SPR-9532 and commented
I found an interesting issue using the
@RequestMapping
annotations at both class-level and method-level. An ambiguous mapping exception will be thrown if there is a method which maps to empty string and also a method which maps to the same path as the class-level mapping.Example:
From the logs in my test server it seems like it finds the class-level mapping when it is attempting to map the subTestHandler(); mapping. This is specific only to using the empty string mapping and also another method mapping which is the same as the class-level mapping.
Granted you could rename the method-level mapping, this doesn't seem like desired functionality.
Affects: 3.1.1
The text was updated successfully, but these errors were encountered: