Summary: | ServletContext.getResourceAsStream() does not follow API specs for Path | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | George Sexton <gsexton> |
Component: | Servlet & JSP API | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 5.5.23 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
test war
one way of fixing this |
Description
George Sexton
2007-08-29 12:54:18 UTC
Created attachment 20919 [details]
test war
Adding test war.
Created attachment 20920 [details]
one way of fixing this
Here's a simple patch which "fixes" the problem. getResourceAsStream can not
throw an Exception (according to the spec), so I just return null.
I'm ambivalent about this patch. This may create problems for some people who
depend on the incorrect usage of this function. Plus, there may be a better
solution, such as always returning an input stream containing "42"
Whilst I like the '42' idea, I am fairly sure not everyone else shares my sense of humour so null it will have to be. Patch applied to trunk and proposed for 5.5.x and 6.0.x. Many thanks for the patch. Fixed in 6.0.x Fixed in 5.5.x and will be included in 5.5.26 onwards. Fixed in 5.5.x and will be included in 5.5.26 onwards. |