Commits

Anonymous committed 703015c

Fixing ServletRedirectResult to add a '/' between the context and the location for local redirects

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@21573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 69845d8

Comments (0)

Files changed (3)

+After Beta 1
+- ServletRedirectResult was not adding the '/' between the context and the redirect location, now it does

src/java/com/opensymphony/webwork/dispatcher/ServletRedirectResult.java

         if (location.startsWith("/")) {
             response.sendRedirect(location);
         } else {
-            response.sendRedirect(request.getContextPath() + location);
+            response.sendRedirect(request.getContextPath()+ "/" + location);
         }
     }
 }

src/test/com/opensymphony/webwork/dispatcher/ServletRedirectResultTest.java

         responseMock = new Mock(HttpServletResponse.class);
 
         requestMock = new Mock(HttpServletRequest.class);
-        requestMock.matchAndReturn("getContextPath", "/context/");
+        requestMock.matchAndReturn("getContextPath", "/context");
 
         ActionContext ac = new ActionContext(Ognl.createDefaultContext(null));
         ActionContext.setContext(ac);