-
Bug
-
Resolution: Done
-
Major
-
8.0.0.Alpha1
-
None
ServletContext getResourcePaths should return "relative paths", according to
the result of which the returned paths won't work if passed to ServletContext getResource method, which expects relative paths and will return null URLs
Having a simple servlet
Set<String> paths = req.getServletContext().getResourcePaths("/WEB-INF/classes"); resp.setContentType("text/plain"); PrintWriter writer = resp.getWriter(); for (String path : paths) { writer.println(path + " , url: " + req.getServletContext().getResource(path)); } writer.close();
will result in
/home/maschmid/testing/wildfly-8.0.0.Alpha2-SNAPSHOT/standalone/tmp/vfs/temp9578b420b6a0dfd8/content-b6b9429f41b85866/WEB-INF/classes/hello.resource , url: null /home/maschmid/testing/wildfly-8.0.0.Alpha2-SNAPSHOT/standalone/tmp/vfs/temp9578b420b6a0dfd8/content-b6b9429f41b85866/WEB-INF/classes/my.properties , url: null /home/maschmid/testing/wildfly-8.0.0.Alpha2-SNAPSHOT/standalone/tmp/vfs/temp9578b420b6a0dfd8/content-b6b9429f41b85866/WEB-INF/classes/org , url: null
while the expected output would be, e.g. the following result of EAP 6.1:
/WEB-INF/classes/hello.resource , url: jndi:/default-host/jboss-as-helloworld/WEB-INF/classes/hello.resource /WEB-INF/classes/org/ , url: jndi:/default-host/jboss-as-helloworld/WEB-INF/classes/org/ /WEB-INF/classes/my.properties , url: jndi:/default-host/jboss-as-helloworld/WEB-INF/classes/my.properties