And personally, I'm leaning towards saying Jetty having the correct
behavior. If the war contains WEB-INF/classes/, I would expect
ServletContext.getResourcePaths("/WEB-INF/") to contain
"/WEB-INF/classes/").
Eirik.
2011/12/15 Eirik Bjørsnøs <eirbjo_at_gmail.com>:
> Experts of the Servlets,
>
> When Glassfish unpacks a war file and encounters an empty directory
> entry, it ignores the entry.
>
> When Jetty unpacks the same war file, it creates a directory for the
> entry in the destination path.
>
> This leads to inconsistent behavior for web applications calling
> ServletContext.getResourcePaths("/WEB-INF/") when "WEB-INF/classes/"
> is an empty entry in the war file.
>
> For me, this inconsistency creates noise when testing the
> ResourceLoader implementations of GlassFish and Jetty, since the test
> doesn't really know what to expect.
>
> I can always work around it by adding files to the directory
> (WEB-INF/classes/dontdelete.txt), but that's a pretty ugly hack.
>
> Can the Expert Group please clarify the correct behavior for empty
> directory entries, and I will follow up with a bug report and patches
> to either Glassfish/Tomcat or Jetty.
>
> (I know this is a minor detail, but that's what the world is made of :-)
>
> Thanks,
> Eirik.