| Summary: | Servlet 3.0 spec 9.3 include and missing files | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | David Jencks <david.a.jencks> |
| Component: | server | Assignee: | Greg Wilkins <gregw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jetty-inbox, mgorovoy |
| Version: | 8.0.0 | ||
| Target Milestone: | 7.1.x | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
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 |
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); + }