https://issues.apache.org/bugzilla/show_bug.cgi?id=56637

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Those same Javadocs also state:

<quote>
The path must be specified according to the rules given in getResource.
</quote>

which in turn states:

<quote>
The path must begin with a / ...
</quote>

The behaviour of getResourceAsStream() if the path does not start with / is
undefined. In Tomcat 8 (which has a different resources implementation to
Tomcat 7) we opted to throw an exception to make clear to the calling code that
it has a bug rather than returning null which masks the problem.

getResourceAsStream() is only defined to return null if the resource does not
exist. That does not apply in this case since the provided path is invalid.

If you think the specification should define the behaviour then you should
lobby the Servlet EG for a clarification. I'd argue that the clarification
should be that an exception is thrown.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to