-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Different behaviour of DefaultServlet in Jetty 12 #10296
Comments
@rakeshk15 can you please report:
|
In Jetty <12 the So we ended up going for a much simpler solution without an optional parameter that uses the pathInfoOnly if the servlet is not mapped to the default path. This is now implemented in the new method |
thanks @gregw for the explanation, I'll check the method you mentioned above. @janbartel here is the information you asked.
Jetty 12 Jetty 11 |
See some discussion here: #9910 |
@rakeshk15 do you allow users to add arbitrary servlets and filters to your |
@joakime only the servlets and filters from the |
@rakeshk15 as @gregw said, the behaviour changed a bit in jetty-12 due to the complexities of the |
Jetty version(s)
Jetty 12.0.0
Java version/vendor
Java 17
OS type/version
macOS Ventura 13.5
Description
I was using Jetty 11.0.15 in embedded mode and mounted the DefaultServlet at
/static/*
with resource base to a directorywebapp
in one of the jar at the classpathSo the full base path becomes
jar:file:/<jar-full-path>!/webapp
And this webapp directory contains the static folder which has the images, css, js etc.
When a static resources such as
http://localhost:8080/static/img/logo.png
is requested by browser then it results in a 404.The same path is successfully served by Jetty 11
It appears that the servlet path was taken into account in Jetty 11 while looking for the resource which is appended to the resource base path.
To circumvent this I had to change the resource base path to
/webapp/static
and now Jetty 12 is also serving the resources.Can someone please tell why there is a deviation in logic from Jetty 11 to 12?
The text was updated successfully, but these errors were encountered: