Add trailing slash support to AbstractUrlHandlerMapping

Issue: SPR-12818
This commit is contained in:
Rossen Stoyanchev
2015-04-13 15:33:25 -04:00
parent b18053f93a
commit c172d9d745
3 changed files with 34 additions and 0 deletions

View File

@@ -110,6 +110,11 @@ public class SimpleUrlHandlerMappingTests {
assertTrue("Handler is correct bean", hec != null && hec.getHandler() == otherBean);
assertEquals("welcome.x", req.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE));
req = new MockHttpServletRequest("GET", "/welcome/");
hec = getHandler(hm, req);
assertTrue("Handler is correct bean", hec != null && hec.getHandler() == otherBean);
assertEquals("welcome", req.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE));
req = new MockHttpServletRequest("GET", "/");
req.setServletPath("/welcome.html");
hec = getHandler(hm, req);