jakartaee / jakartaee/servlet

Clarify whether javax.servlet.error.exception_type and javax.servlet.error.exception refer to a wrapped or unwrapped ServletException

Open
#388 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
325
Forks
112
PR merge metrics
No merged PRs in 30d

Description

From section 10.9.2 Error Pages:

> If no error-page declaration containing an exception-type fits using the class-
> hierarchy match, and the exception thrown is a ServletException or subclass
> thereof, the container extracts the wrapped exception, as defined by the
> ServletException.getRootCause method. A second pass is made over the error
> page declarations, again attempting the match against the error page declarations,
> but using the wrapped exception instead.

This section does not make clear when a ServletException is thrown that contains a wrapped exception, if the values of the request attributes `javax.servlet.error.exception_type` and `javax.servlet.error.exception `should be the unwrapped exception or not.

Setting them to the unwrapped exception will remove stacktrace information that may be valuable.

On the other hand, the current servlet-tck seems to test that the values are unwrapped - see https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/servlet/spec/errorpage/URLClient.java#L76

Contributor guide

Open the contributing guide

Research direction

Read section 10.9.2, “Error Pages,” and compare its wording with the servlet-TCK check in src/com/sun/ts/tests/servlet/spec/errorpage/URLClient.java at line 76. Determine whether javax.servlet.error.exception_type and javax.servlet.error.exception should expose the wrapped or unwrapped exception, then clarify the specification and align the test expectation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.