-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetty 12.1.x tck error message #12011
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a minimal fix just to pass the TCK, then it needs a TODO saying so
@@ -73,6 +73,14 @@ public boolean errorPageForMethod(String method) | |||
}; | |||
} | |||
|
|||
private static Object getRequestErrorAttribute(HttpServletRequest request, String servletApiName, String jettyName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this method necessary?
I thought the policy was that we would always set the jetty(core) attribute and then any request wrapper used for an error dispatch to a filter/servlet would intercept the servlet attributes and lookup the jetty ones
So our code should then only ever need to lookup jetty(core) attributes? Unless there is a case where an application sets them and we are expected to act on them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is part of the refactoring effort, which is a much wider scope than just satisfying the tck.
{ | ||
Object o = request.getAttribute(servletApiName); | ||
if (o == null) | ||
o = request.getAttribute(jettyName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o = request.getAttribute(jettyName); | |
o = request.getAttribute(coreAttributeName); |
@@ -73,6 +73,14 @@ public boolean errorPageForMethod(String method) | |||
}; | |||
} | |||
|
|||
private static Object getRequestErrorAttribute(HttpServletRequest request, String servletApiName, String jettyName) | |||
{ | |||
Object o = request.getAttribute(servletApiName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object o = request.getAttribute(servletApiName); | |
Object o = request.getAttribute(servletAttributeName); |
This PR fixes the output of ErrorHandler in accordance with TCK expectations. See #11931 (comment).
There is also a branch for entirely refactoring the servlet api
ErrorHandler
(https://github.com/jetty/jetty.project/tree/jetty-12.1.x-refactor-servlet-error-handler) however that is orthogonal to this fix.