From c984d2587106555d72cd6f94413d6f5fcf67169b Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Mon, 19 Sep 2011 17:57:48 +1000 Subject: [PATCH] 358027 NullPointerException in ResourceHandler with jetty-stylesheet.css --- .../eclipse/jetty/server/handler/ResourceHandler.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java index 87be3d7b3fd..5d618165ed7 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.resource.Resource; * * This handle will serve static content and handle If-Modified-Since headers. * No caching is done. - * Requests that cannot be handled are let pass (Eg no 404's) + * Requests for resources that do not exist are let pass (Eg no 404's). * * * @org.apache.xbean.XBean @@ -205,7 +205,7 @@ public class ResourceHandler extends AbstractHandler { try { - _defaultStylesheet = Resource.newResource(this.getClass().getResource("/jetty-default.css")); + _defaultStylesheet = Resource.newResource(this.getClass().getResource("/jetty-dir.css")); } catch(IOException e) { @@ -326,7 +326,7 @@ public class ResourceHandler extends AbstractHandler /* ------------------------------------------------------------ */ /* - * @see org.eclipse.jetty.server.server.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int) + * @see org.eclipse.jetty.server.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int) */ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -344,7 +344,7 @@ public class ResourceHandler extends AbstractHandler Resource resource = getResource(request); if (resource==null || !resource.exists()) { - if (target.endsWith("/jetty-stylesheet.css")) + if (target.endsWith("/jetty-dir.css")) { response.setContentType("text/css"); resource = getStylesheet(); @@ -359,7 +359,7 @@ public class ResourceHandler extends AbstractHandler return; } - // We are going to server something + // We are going to serve something baseRequest.setHandled(true); if (resource.isDirectory())