incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r889422 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
Date Thu, 10 Dec 2009 20:58:18 GMT
Author: fmeschbe
Date: Thu Dec 10 20:58:17 2009
New Revision: 889422

URL: http://svn.apache.org/viewvc?rev=889422&view=rev
Log:
SLING-1229 just log an error message if the request is included or the response committed
in case no renderer can be found for the requested extension.

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

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java?rev=889422&r1=889421&r2=889422&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
Thu Dec 10 20:58:17 2009
@@ -221,14 +221,17 @@
         if (rendererServlet == null) {
             request.getRequestProgressTracker().log(
                 "No renderer for extension " + ext);
-            final boolean isIncluded = request.getAttribute(SlingConstants.ATTR_REQUEST_SERVLET)
!= null;
             // if this is an included request, sendError() would fail
-            // as the response is already committed, in this case we throw an exception
-            if ( isIncluded ) {
-                throw new ServletException("No renderer found for extension " + ext 
-                        + " while including " + request.getResource());
+            // as the response is already committed, in this case we just
+            // do nothing (but log an error message)
+            if (response.isCommitted()
+                || request.getAttribute(SlingConstants.ATTR_REQUEST_SERVLET) != null) {
+                logger.error(
+                    "No renderer for extension {}, cannot render resource {}",
+                    ext, request.getResource());
+            } else {
+                response.sendError(HttpServletResponse.SC_FORBIDDEN);
             }
-            response.sendError(HttpServletResponse.SC_FORBIDDEN);
             return;
         }
 



Mime
View raw message