Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] jetty 11 replacement for WebsocketHandler

Hi there,
we are currently upgrading to jetty 11. With jetty 9, we were only using handlers and no servlets at all. That is why we used the WebsocketHandler to do a programmatic upgrade. 

There is an example on how to do a programmatic upgrade in the docs (ProgrammaticWebSocketUpgradeServlet). However, it seems like you need to pass a ServletContext to JettyWebSocketServerContainer#getContainer. We don't have one, so we can't obtain a reference to the JettyWebSocketServerContainer (servletContext on baseRequest passed to handlers is null).
Do we need to use Servlets/ServletContext now? Or is there a way to stick to handlers?

Best,
Matthias

Reference to doc: https://www.eclipse.org/jetty/documentation/jetty-11/programming-guide/index.html#pg-server-websocket-jetty


Back to the top