我需要一个带有多个 servletHandler 的码头服务器。
HTTPservlet:
ServletHandler servletHandler = new ServletHandler();
server.setHandler(servletHandler);
servletHandler.addServletWithMapping("com.realtime.webserver.MyServlet", "/MyServlet");
WebsocketServlet:
MyWebSocketHandler myWebSocketHandler = new MyWebSocketHandler ();
myWebSocketHandler.setHandler(new DefaultHandler());
server.setHandler(myWebSocketHandler);
server.start();
我需要两者都应该在单个服务器中。有没有可能?