Description
Jetty Version
12.0.14
Jetty Environment
ee10
Java Version
17
Question
I try to migrate from jetty 9 to 12.
And It seems migration is pretty smooth 👍 but I get this warning :
2024-11-04 16:05:43,996 DefaultServlet [WARN] DefaultServlet pathInfoOnly is set to true. Use ResourceServlet instead.
2024-11-04 16:06:09,081 DefaultServlet [WARN] Incorrect mapping for DefaultServlet at /*. Use ResourceServlet
Until now, I was using DefaultServlet
as a way to serve static resource. (without really understand the concept)
With jetty12/ee10, I understand that I should rather use a ResourceServlet
for that.
This lead me to the question what is the purpose of DefaultServlet
?
I read lot about this but still not clear to me:
- https://stackoverflow.com/a/20223103/5088764
- Jetty 12.0.x resource Servlet #11933 (comment)
- Can't get jetty 12.0.14 to work with welcome files on servlets #12455
I describe my use case in case it helps.
I use jetty programmatically without using xml configuration.
I serve static resource from webapp
directory of the jar of my java application and I have some REST API under /api/*
You can have a look at the code jetty 9 code and or jetty 12 version one (almost the same) from eclipse-leshan/leshan#1667.