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

Jetty 12 : EE10 implement default servlet serving jetty-dir.css

Open lorban opened this issue 3 years ago • 5 comments

Make ee10 DefaultServlet able to serve jetty-dir.css

lorban avatar Aug 08 '22 13:08 lorban

We have to decide if we like this mechanism or not. If we do, ResourceCollection needs a way to be able to return the non-dir resources it contains from a call to resolve.

If we don't, jetty-dir.css needs to be served in some other way which involves making the ResourceContentFactory or its parent serve jetty-dir.css to avoid bypassing the CachingContentFactory that wraps ResourceContentFactory, i.e.: that logic cannot be in ResourceService unless we want to bypass CachingContentFactory.

ee9 is implemented by making DefaultServlet being able to serve jetty-dir.css, implement ResourceFactory and be wrapped by ResourceContentFactory.

lorban avatar Aug 12 '22 12:08 lorban

Oh and favicon went away because it's supposed to be served by DefaultHandler, not by any DefaultServlet nor ResourceHandler.

lorban avatar Aug 12 '22 12:08 lorban

See https://github.com/eclipse/jetty.project/issues/8443 and https://github.com/eclipse/jetty.project/issues/8456

lorban avatar Aug 12 '22 12:08 lorban

We have to decide if we like this mechanism or not. If we do, ResourceCollection needs a way to be able to return the non-dir resources it contains from a call to resolve.

I don't understand? ResourceCollection has always been able to resolve non-dir resources. The complications in this PR appear to be from an effort to make a collection containing non-dir resources? what is the use-case for that?

If we don't, jetty-dir.css needs to be served in some other way which involves making the ResourceContentFactory or its parent serve jetty-dir.css to avoid bypassing the CachingContentFactory that wraps ResourceContentFactory, i.e.: that logic cannot be in ResourceService unless we want to bypass CachingContentFactory.

jetty-dir.css definitely needs to be served in some other way than having it part of a resource collection. It is a synthetic resource that "appears" to exist in every directory even if it is not there. It is best handled, as it was previously, with an interception of the URI before resolving the resource (or perhaps after a not found resource).

gregw avatar Aug 12 '22 22:08 gregw

See commit e0a9c21, which added a directory test with commented out jetty-dir.css checks

gregw avatar Aug 15 '22 00:08 gregw

This can be closed.

joakime avatar Sep 23 '22 18:09 joakime