incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1211523 - in /sling/trunk/bundles/servlets/get: pom.xml src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java
Date Wed, 07 Dec 2011 16:37:59 GMT
Author: cziegeler
Date: Wed Dec  7 16:37:59 2011
New Revision: 1211523

URL: http://svn.apache.org/viewvc?rev=1211523&view=rev
Log:
SLING-2324 : The recursion selector value for the JsonRenderServlet is limited to Integer.MAX_VALUE.
Applied patch from Antonio Sanso

Modified:
    sling/trunk/bundles/servlets/get/pom.xml
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java

Modified: sling/trunk/bundles/servlets/get/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/pom.xml?rev=1211523&r1=1211522&r2=1211523&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/pom.xml (original)
+++ sling/trunk/bundles/servlets/get/pom.xml Wed Dec  7 16:37:59 2011
@@ -111,5 +111,11 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.4</version>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java?rev=1211523&r1=1211522&r2=1211523&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java
Wed Dec  7 16:37:59 2011
@@ -21,6 +21,7 @@ import java.io.IOException;
 import javax.jcr.RepositoryException;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
@@ -79,9 +80,14 @@ public class JsonRendererServlet extends
                     try {
                         maxRecursionLevels = Integer.parseInt(level);
                     } catch (NumberFormatException nfe) {
-                        resp.sendError(HttpServletResponse.SC_BAD_REQUEST,
-                            "Invalid recursion selector value '" + level + "'");
-                        return;
+                    	//SLING-2324
+                    	if (StringUtils.isNumeric(level)){
+                    		maxRecursionLevels = -1;
+                    	}else{
+                    		resp.sendError(HttpServletResponse.SC_BAD_REQUEST,
+                    				"Invalid recursion selector value '" + level + "'");
+                    		return;
+                    	}
                     }
                 }
             }



Mime
View raw message