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
ExternalContext.dispatch Javadocs Should Match Implementation #1136
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
Currently the Javadocs for ExternalContext.dispatch method say:
@throws IllegalArgumentException if no request dispatcher
@throws NullPointerException if
path
null
However the implementation does this:
RequestDispatcher requestDispatcher = request.getRequestDispatcher(
requestURI);
if (requestDispatcher == null)
{ ((HttpServletResponse) response). sendError(HttpServletResponse.SC_NOT_FOUND); return; }
The servlet specification indicates that a null RequestDispatcher will be returned if one cannot be created (for example by passing in a null argument to request.getRequestDispatcher). The JavaDocs for ExternalContextDispatcher should be changed as follows:
1. remove throws IllegalArgumentException, NullpointerException verbage.
2. add "If the call to
getRequestDisatcher(path)
returns null, send aServletResponse SC_NOT_FOUND
error code.Affected Versions
[2.2]
The text was updated successfully, but these errors were encountered: