use of org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer in project spring-framework by spring-projects.
the class JettyWebSocketTestServer method deployConfig.
@Override
public void deployConfig(WebApplicationContext wac, Filter... filters) {
ServletHolder servletHolder = new ServletHolder(new DispatcherServlet(wac));
this.contextHandler = new ServletContextHandler();
this.contextHandler.addServlet(servletHolder, "/");
this.contextHandler.addServletContainerInitializer(new JettyWebSocketServletContainerInitializer());
for (Filter filter : filters) {
this.contextHandler.addFilter(new FilterHolder(filter), "/*", getDispatcherTypes());
}
this.jettyServer.setHandler(this.contextHandler);
}
use of org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer in project spring-framework by spring-projects.
the class JettyHttpServer method initServer.
@Override
protected void initServer() throws Exception {
this.jettyServer = new Server();
ServletHttpHandlerAdapter servlet = createServletAdapter();
ServletHolder servletHolder = new ServletHolder(servlet);
servletHolder.setAsyncSupported(true);
this.contextHandler = new ServletContextHandler(this.jettyServer, "", false, false);
this.contextHandler.addServlet(servletHolder, "/");
this.contextHandler.addServletContainerInitializer(new JettyWebSocketServletContainerInitializer());
this.contextHandler.start();
ServerConnector connector = new ServerConnector(this.jettyServer);
connector.setHost(getHost());
connector.setPort(getPort());
this.jettyServer.addConnector(connector);
}
Aggregations