jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

`ServletContext.getResourceAsStream(String)` must use `URLConnection` per Servlet Spec.

Open joakime opened this issue 1 year ago • 1 comments

Jetty version(s) 12.0.7

Jetty Environment Any

Java version/vendor (use: java -version) Any

OS type/version Any

Description Per the Servlet Spec API docs on ServletContext.getResourcesAsStream(String) the returned InputStream must use URLConnection. The implementation of ServletContext in ee10 / ee9 / ee8 does not use URLConnection.

  • Servlet 6 - https://github.com/jakartaee/servlet/blob/6.0.0/api/src/main/java/jakarta/servlet/ServletContext.java#L295
  • Servlet 5 - https://github.com/jakartaee/servlet/blob/5.0.0/api/src/main/java/jakarta/servlet/ServletContext.java#L303
  • Servlet 4 - https://github.com/jakartaee/servlet/blob/4.0.4/api/src/main/java/javax/servlet/ServletContext.java#L305

joakime avatar Mar 20 '24 18:03 joakime

I'm not convinced this is a bug, so I've removed that label. We can discuss before proceeding.

janbartel avatar Mar 25 '24 17:03 janbartel

I agree this is not an issue. Closing!

gregw avatar Aug 28 '24 22:08 gregw