Skip to content
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

Error page lookup does not conform to the servlet spec #156

Closed
VsevolodGolovanov opened this issue Aug 5, 2015 · 1 comment
Closed

Error page lookup does not conform to the servlet spec #156

VsevolodGolovanov opened this issue Aug 5, 2015 · 1 comment
Labels

Comments

@VsevolodGolovanov
Copy link

WebXml#findErrorPageLocation is incorrect, because it doesn't satisfy the rule of the servlet spec: The closest match in the class hierarchy wins. WebXml uses the first encountered superclass instead.
Here is how Undertow does it:

String location = null;
for (Class c = exception.getClass(); c != null && location == null; c = c.getSuperclass()) {
    location = exceptionMappings.get(c);
}

https://github.com/undertow-io/undertow/blob/master/servlet/src/main/java/io/undertow/servlet/core/ErrorPages.java

WebXml also doesn't do the unwrap the ServletException and do a second pass step, but I guess this is intentional, because WebXml#findErrorPageLocation is intended to be called inside the Servlet#service execution, before ServletException wrapping could occur.

@BalusC BalusC closed this as completed in 89b677d Aug 5, 2015
@BalusC
Copy link
Member

BalusC commented Aug 5, 2015

Fix is available in today's snapshot. Thank you for reporting!

@BalusC BalusC added the bug label Oct 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants