-
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
Inconsistent handling of empty "path info" between Jetty 10 and 12 #9906
Comments
@grgrzybek we're very happy to have people looking at jetty12! I'll look into this for you. Can you confirm you are using |
@janbartel I've renamed the Pax Web issue (I'll skip JakartaEE 9 / Servlet API 5 and go directly to 10 / 6). And yes - this is definitely I hope I can help with the compliance (as with #9119). |
@grgrzybek as a temporary work around, if you want to get further in your coding while I reproduce and dig into this, you could try using the urls |
Yes - that's how it worked for me ;) |
BTW, I got confused with:
The first one doesn't seem to be used. While it was used by |
@grgrzybek yep, we shouldn't have 2 methods like that, fix will be coming. Following up on difference between path info as "" or forcing it to be "/" like we did in jetty-10/11 and probably jetty9 as well. |
@grgrzybek I've raised PR #9907. You might like to try out that branch and see if that fixes your problem. Note what I said in the PR, that we will not force the path on the server side to be So hopefully this fix will allow you to still get your content served in the way you have been used to, but leaving the path as |
Thanks - over next days/weeks, I'll try to work more on Pax Web migration from I remember that (from Pax Web point of view) handling these weird URIs that use context path only without trailing slash was a bit tricky and all runtimes (Jetty, Tomcat, Undertow) have non-standard ways to handle it.
Fortunately, I chose (in Pax Web) to always redirect |
* Issue #9906 Empty path info * Update jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletContextHandlerTest.java Co-authored-by: Olivier Lamy <[email protected]> * Update jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletContextHandlerTest.java Co-authored-by: Olivier Lamy <[email protected]> --------- Co-authored-by: Olivier Lamy <[email protected]>
I agree. I won't expect "/c1" request to be handled by default servlet anymore. Please close this issue then. |
Jetty version(s)
12.0.0.beta1
Java version/vendor
(use: java -version)
OS type/version
Description
When trying to use ServletContextHandler with default servlet only, there's different behavior between Jetty 10 and 12.
How to reproduce?
I'm working on Pax Web (OSGi CMPN implementation of web related specification based on Jetty, Tomcat and Undertow). When trying to move to
jakarta
namespace (JakartaEE 10 / Servlet API 6), I now check if everything works consistently.One of the "showcase tests" (where I try to provide canonical embedded examples) is (Jetty 10): https://github.com/ops4j/org.ops4j.pax.web/blob/web-9.0.9/pax-web-jetty/src/test/java/org/ops4j/pax/web/service/jetty/internal/EmbeddedJettyTest.java#L356-L443
Roughly speaking there's:
/c1
and/c2
to the above chcServletContextHandler#setAllowNullPathInfo(true)
andContextHandler#setAllowNullPathInContext(true)
/
GET /c1
andGET /c2
In Jetty 10.0.15, I'm at this stage:
target
parameter is/c1
and this branch is invoked:Then in
org.eclipse.jetty.servlet.ServletHandler#getMatchedServlet()
target is/
and proper mapping is taken using:However in Jetty 12.0.0.beta1, there's different code being called here:
and it's this branch (
encodedContextPath
==encodedPath
==/c1
):this time
org.eclipse.jetty.ee10.servlet.ServletHandler#getMatchedServlet()
is being passed""
value and while_servletPathMap
is correct:this fragment is used instead:
and
null
is returned.I know that Jetty 12 is still being worked on, but I hope you don't mind reporting such differences ;)
The text was updated successfully, but these errors were encountered: