Community
Participate
Working Groups
Last paragraph of section 9.3 indicates that the default servlet must, when content is missing and dispatch was an include, throw a FileNotFound exception. This bit of patch to DefaultServlet (already patched for the content-length problem with filters) seems to fix the issue: @@ -456,7 +458,11 @@ // Handle resource if (resource==null || !resource.exists()) - response.sendError(HttpServletResponse.SC_NOT_FOUND); + if (included) { + throw new FileNotFoundException("Nothing at " + pathInContext); + } else { + response.sendError(HttpServletResponse.SC_NOT_FOUND); + }
This paragraph in the servlet 3 spec was not in the 2.4 spec (section 8.3 there). However I think this behavior might be useful in jetty 7 as well since currently trying to include a non-existent static resource fails with no notice to the including servlet.
fixed in jetty 7 (trunk) rev 2271
fix looks good