Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce EE10 ResourceServlet #10738

Closed
lorban opened this issue Oct 16, 2023 · 5 comments · Fixed by #11933
Closed

Introduce EE10 ResourceServlet #10738

lorban opened this issue Oct 16, 2023 · 5 comments · Fixed by #11933
Assignees

Comments

@lorban
Copy link
Contributor

lorban commented Oct 16, 2023

Jetty version(s)
12.0.x

Enhancement Description
Currently, the EE10 DefaultServlet tries to do too many things: being the default servlet bound to the root of the context as well as a general-purpose resource-serving servlet, and some requirements of both facets sometimes clash with each other.

A new ResourceServlet should be introduced to allow general-purpose resource-serving with all the configurable settings while not being designed to be bound to the root of the context.

See #10739 for the DefaultServlet issue.

@janbartel
Copy link
Contributor

@lorban we should schedule this

@lorban
Copy link
Contributor Author

lorban commented Jun 10, 2024

@janbartel we should take the time to form a plan, as #9080 and #10739 are related and #8790 should at least be kept at the back of our mind.

I'm not yet sure if we should redesign our current content handling architecture or modify just the necessary bits to split the default servlet.

@gregw
Copy link
Contributor

gregw commented Jun 10, 2024

@lorban I think we need to get moving on this. There is not much time between now and 12.1.0

I don't see why we can't immediately in 12.0.x split DefaultServlet into a ResourceServlet that is extended to be the DefaultServlet. The extended DefaultServlet would only need to mix in: a) that resources come from the context resourceBase; b) how the pathInContext is used to request a context.
The ResourceServlet itself can be a lot more flexible about those assumptions.

If the API split is not 100% correct then: users can continue to use DefaultServlet as they are now (but we really don't want them to); plus we will have the break to 12.1.x to refine the API.

I think most of the other resource issues can be done orthogonal to these kind of changes... although I would not we need to get a hurry on with those as well in the 12.1.x timeframe.

@gluser1357
Copy link

Would ResourceServlet be specific for Jetty (in contrast to the <servlet-name>default</servlet-name> mechanism for DefaultServlet that works e. g. for both Jetty and Tomcat)? That would be great since the same web.xml could be used for both servers (see also #11884).

@gregw
Copy link
Contributor

gregw commented Jun 26, 2024

@gluser1357 ResourceServlet will still be jetty specific, as there are many jetty internals that it can deal with that will make serving static content more efficient.
Creating a portable ResourceServlet may indeed be a good idea, but it would be hard to do that within the jetty project. Having an artifact from a non server project would be the best place for that, so it would not have any dependencies on either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants