sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1066361 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
Date Wed, 02 Feb 2011 08:09:40 GMT
Author: fmeschbe
Date: Wed Feb  2 08:09:40 2011
New Revision: 1066361

URL: http://svn.apache.org/viewvc?rev=1066361&view=rev
Log:
SLING-1965 Append current query string to redirect target for all target URLs, not just absolute
URLs

Modified:
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java?rev=1066361&r1=1066360&r2=1066361&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
Wed Feb  2 08:09:40 2011
@@ -149,6 +149,11 @@ public class RedirectServlet extends Sli
                 targetPath = toRedirectPath(targetPath, request);
             }
 
+            // append current querystring
+            if (request.getQueryString() != null) {
+                targetPath += "?" + request.getQueryString();
+            }
+
             final int status = getStatus(valueMap);
 
             // redirect the client, use our own setup since we might have a
@@ -237,11 +242,6 @@ public class RedirectServlet extends Sli
             }
         }
 
-        // append current querystring
-        if (request.getQueryString() != null) {
-            target.append('?').append(request.getQueryString());
-        }
-
         // return the mapped full path and return if already an absolute URI
         final String finalTarget = request.getResourceResolver().map(request, target.toString());
         if (isUrl(finalTarget)) {



Mime
View raw message