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

jetty-12 ee10 Cross context dispatch is not supported #9774

Closed
janbartel opened this issue May 16, 2023 · 1 comment
Closed

jetty-12 ee10 Cross context dispatch is not supported #9774

janbartel opened this issue May 16, 2023 · 1 comment
Assignees
Labels
Bug For general bugs on Jetty side TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc)

Comments

@janbartel
Copy link
Contributor

jetty-12 does not (yet) support cross-context dispatch. Thus, we need to return null for calls to the method ServletContextApi.getContext(String).

This is also tck related, as there are many cross-context dispatch tests which should really test if the container supports cross-context before proceeding with the test - see jakartaee/servlet#488

@janbartel janbartel added Bug For general bugs on Jetty side TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc) labels May 16, 2023
@janbartel janbartel self-assigned this May 16, 2023
janbartel added a commit that referenced this issue May 16, 2023
janbartel added a commit that referenced this issue May 18, 2023
* Issue #9774 Disallow cross context
@janbartel
Copy link
Contributor Author

Fixed via #9775

gregw added a commit that referenced this issue May 19, 2023
Cross context is not support
paulrutter added a commit to blueconic/felix-dev that referenced this issue Apr 29, 2024
cziegeler pushed a commit to apache/felix-dev that referenced this issue May 1, 2024
* Revert "Add jetty websocket support to Jetty12  (#298)"

This reverts commit 6d95c93.

* FELIX-6692 Add Jetty WebSocket support for jetty 12.x
- Apply 11.x approach to jetty12 bundle
- Add two new classifiers 'with-jetty-ee10-websockets' and 'with-jakarta-ee10-websockets' to have a fat jar containing the appropriate websocket classes

* Working example base on previous code.
Do note that the workaround in FelixJettyWebSocketServlet are still required; the initialization code in the Jetty12 bundle doesn't seem to work

* * Enable cross context support to allow WebSockets to be registered in Jetty 12.
See https://github.com/jetty/jetty.project/blob/jetty-12.0.x/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java#L510 and jetty/jetty.project#9774

* Add example based on registering the websocket to the main servlet context instead of the per-bundle one
-

* Added paxweb unit tests based on the Jetty11 work from #309

* Fix version

* Fix message

* Test casing

* Update README.md

* Make client optional

* Add Jetty12 bundle to pom

* Store the WebSocket container reference and set it on the shared servlet context once available
This removes the need to set setCrossContextDispatchSupported, as the WS container is available on the proper servlet context itself

* Update example to no longer use the root context.
Removed other WebSocket example, as this is no longer needed with the new approach.
Updated documentation.

* Add servlet based example again, as it shows another example of how to register a WebSocket endpoint that abides to the servlet context it's registered to.

* Rename class

* Comment

* Comments

* Remove classloader code as it now also works without

* Rename test class to EE10

* Small changes to README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc)
Projects
None yet
Development

No branches or pull requests

1 participant