SPR-5731 - @Controller method order effects @RequestMapping behavior in ways not expected

This commit is contained in:
Arjen Poutsma
2009-05-11 10:34:56 +00:00
parent fbd921f25a
commit 752832a8da
2 changed files with 21 additions and 18 deletions

View File

@@ -264,20 +264,21 @@ public class UriTemplateServletAnnotationControllerTests {
}
@Controller
@RequestMapping("/hotels")
public static class AmbiguousUriTemplateController {
@RequestMapping("/hotels/new")
public void handleSpecific(Writer writer) throws IOException {
writer.write("specific");
}
@RequestMapping("/hotels/{hotel}")
@RequestMapping("/{hotel}")
public void handleVars(@PathVariable("hotel") String hotel, Writer writer) throws IOException {
assertEquals("Invalid path variable value", "42", hotel);
writer.write("variables");
}
@RequestMapping("/hotels/*")
@RequestMapping("/new")
public void handleSpecific(Writer writer) throws IOException {
writer.write("specific");
}
@RequestMapping("/*")
public void handleWildCard(Writer writer) throws IOException {
writer.write("wildcard");
}