@RequestParam/RequestHeader/CookieValue's defaultValue allows for declaring empty String (SPR-6791)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2977 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2010-02-15 12:10:55 +00:00
parent a68af057ed
commit c31ad7f14b
6 changed files with 58 additions and 16 deletions
@@ -199,7 +199,7 @@ public class ServletAnnotationControllerTests {
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/myPath.do");
MockHttpServletResponse response = new MockHttpServletResponse();
servlet.service(request, response);
assertEquals("foo-null-bar", response.getContentAsString());
assertEquals("foo--bar", response.getContentAsString());
}
@Test
@@ -1970,7 +1970,7 @@ public class ServletAnnotationControllerTests {
@RequestMapping("/myPath.do")
public void myHandle(@RequestParam(value = "id", defaultValue = "foo") String id,
@RequestParam(value = "otherId", required = false) String id2,
@RequestParam(value = "otherId", defaultValue = "") String id2,
@RequestHeader(defaultValue = "bar") String header,
HttpServletResponse response) throws IOException {
response.getWriter().write(String.valueOf(id) + "-" + String.valueOf(id2) + "-" + String.valueOf(header));