SPR-6640 - PathVariable does not work properly after updated to 3.0 GA

This commit is contained in:
Arjen Poutsma
2010-01-11 11:27:43 +00:00
parent a70f525d4e
commit bb3c8e5c87
2 changed files with 81 additions and 54 deletions

View File

@@ -308,6 +308,19 @@ public class UriTemplateServletAnnotationControllerTests {
assertEquals("test-42", response.getContentAsString());
}
/*
* See SPR-6640
*/
@Test
public void menuTree() throws Exception {
initServlet(MenuTreeController.class);
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/book/menu/type/M5");
MockHttpServletResponse response = new MockHttpServletResponse();
servlet.service(request, response);
assertEquals("M5", response.getContentAsString());
}
/*
* Controllers
@@ -533,4 +546,14 @@ public class UriTemplateServletAnnotationControllerTests {
}
@RequestMapping("/*/menu/**")
public static class MenuTreeController {
@RequestMapping("type/{var}")
public void getFirstLevelFunctionNodes(@PathVariable("var") String var, Writer writer) throws IOException {
writer.write(var);
}
}
}