[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [gemini-dev] Broken WAB resource handling in Tomcat 8
|
Hi again,
Actually, the code that seem to fail is a combination of Servlet.Context.getResourcePaths() and ServletContext.getResourceAsStream(). I'm attaching a modified Gemini Web wab sample with slf4j api jar added in WEB-INF/lib and the following code added in SimpleServlet:
ServletContext servletContext = ...
Set<String> resourcePaths = servletContext.getResourcePaths("/WEB-INF/lib");
String resourcePath = resourcePaths.iterator().next();
InputStream inputStream = servletContext.getResourceAsStream(resourcePath);
System.out.println(String.format("InputStream for resource '%s' is: %s", resourcePath, inputStream));
With Gemini Web 2.2.7 this prints:
InputStream for resource '/WEB-INF/lib/org.slf4j.api.jar' is: org.eclipse.osgi.storage.bundlefile.ZipBundleEntry$ZipBundleEntryInputStream@405822b1
With Gemini Web 3.0 RC2 the result is:
InputStream for resource '/WEB-INF/lib/org.slf4j.api.jar/' is: null
So it seems there is also a difference in the getResourcePaths method - with Tomcat 8 this returns a resource path with a trailing slash.So
Regards,
Detelin
Attachment:
osgi.web.app_1.0.0.war
Description: Binary data