Bruno Konik
2018-05-11 16:24:03 UTC
Hello all,
I would like to know if this is possible to register an http servlet
(HttpServlet) and web socket servlet (WebSocketServlet) for the same path.
ServletContextHandler context = new
ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
context.addServlet(new ServletHolder(new MyWebSocketServlet()), "mypath");
context.addServlet(new ServletHolder(new MyHttpServlet()), "mypath");
Since the url to use the http servlet is http://server/mypath and the url to
use websocket is "ws://server/mypath" (different scheme), I would imagine
that this is possible but I can't manage it.
Thanks for your help.
Bruno
I would like to know if this is possible to register an http servlet
(HttpServlet) and web socket servlet (WebSocketServlet) for the same path.
ServletContextHandler context = new
ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
context.addServlet(new ServletHolder(new MyWebSocketServlet()), "mypath");
context.addServlet(new ServletHolder(new MyHttpServlet()), "mypath");
Since the url to use the http servlet is http://server/mypath and the url to
use websocket is "ws://server/mypath" (different scheme), I would imagine
that this is possible but I can't manage it.
Thanks for your help.
Bruno