Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 6.0.0rc2
-
Fix Version/s: None
-
Component/s: Servlet
-
Labels:None
-
Environment:any
-
Number of attachments :
Description
Java Servlet Specification v. 2.4:
SRV.9.9.3 Error Filters
The error page mechanism operates on the original unwrapped/unfiltered request
and response objects created by the container.
JBoss and Sun Java Application Server do this.
But Jetty (and, actually, Resin too) does error handling in filtered request.
Steps to reproduce:
Deploy http://slonopotamus.org/error-page-bug.war and open any nonexistent page.
On System.err you'll get:
before chain
before chain
in error page
after chain
after chain
Expected output:
before chain
after chain
before chain
in error page
after chain
Well, Jetty certainly uses the unwrapped requests when sendError is called.
However, it does invoke the error page mechanism during the call to sendError and thus while
within the scope of the original filters. It does this because of the language in : SRV.9.9.2
"If the sendError method is called on the response, the container consults the
list of error page declarations for the Web application that use the status-code
syntax and attempts a match. If there is a match, the container returns the resource
as indicated by the location entry."
This indicates that error handling for sendError should take place during the call - thus
the error filters get applied then.... but on the unwrapped request and response.
What is not defines is if the Default servlet should use sendError or not for a 404 - but
it would appear a reasonable choice.
Anyway, I will raise this with the servlet EG and see what they have to say....