-
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
Bring back Jetty <12 flexibility of "current context / context handler" #9925
Comments
@grgrzybek are you saying that in jetty-12 the static method |
@janbartel that's because the passed ServletContext is actually Pax Web's In Jetty 10 it's not a problem, because |
@grgrzybek could your |
Unfortunately no, as it's common for pax-web-tomcat, pax-web-jetty and pax-web-undertow. |
I see
Or add
|
@grgrzybek hope that PR #9933 works for you, as it's been merged. |
@janbartel thanks, but ... almost ;) WebSocket related code is using the 2-arg version: public static ServletContextHandler getServletContextHandler(ServletContext servletContext, String purpose) and I'd still get an exception. |
@grgrzybek ok, committed PR #9941 hopefully that does the trick. |
That should do it! Thanks! I'll confirm on Monday, ok? |
Thanks - I confirmed it works fine!n You can close it. |
Jetty version(s)
Jetty 12.0.0.beta1
Enhancement Description
I work on Pax Web which uses Jetty, Tomcat or Undertow in OSGi environment behind OSGi CMPN web specification facades.
Pax Web 8 uses Jetty 9.4 and Pax Web 9 uses Jetty 10. One of the integration aspects is WebSocket handling (using SCIs and Jetty's
org.eclipse.jetty.ee10.websocket.servlet.WebSocketUpgradeFilter
).Websockets related code (filters, scis) need to use Jetty API directly so in several places, generic
javax|jakarta.servlet.ServletContext
is used to obtain Jetty context and related context handler.In Jetty 10,
org.eclipse.jetty.servlet.ServletContextHandler#getServletContextHandler()
is:where
org.eclipse.jetty.server.handler.ContextHandler#getContextHandler()
is also using thread localorg.eclipse.jetty.server.handler.ContextHandler#__context
.In Jetty 12 this is only:
In OSGi environment we have to pass around different implementation of
javax|jakarta.servlet.ServletContext
to fulfill the contract (like classloader access) and the above code simply doesn't work. With several static methods we can't reimplement them without using shaded versions of Jetty classes (which we don't want to use - except maybe DefaultServlet to unprivate some methods/fields).I see that the
org.eclipse.jetty.server.handler.ContextHandler#__context
thread local is still available in Jetty 12 - can it be used again? Or is it going to be removed?The text was updated successfully, but these errors were encountered: