server.setHandler(contextHandler);
SessionHandler sessionHandler = new SessionHandler();
contextHandler.setHandler(sessionHandler);
ServletHandler servletHandler = new ServletHandler();
sessionHandler.setHandler(servletHandler);
ServletHolder holder = new ServletHolder();
holder.setName("httpTunnel");
holder.setClassName(HttpTunnelServlet.class.getName());
servletHandler.setServlets(new ServletHolder[] {
holder
});
ServletMapping mapping = new ServletMapping();
mapping.setServletName("httpTunnel");
mapping.setPathSpec("/*");
servletHandler.setServletMappings(new ServletMapping[] {
mapping
});
contextHandler.setAttribute("acceptListener", getAcceptListener());
contextHandler.setAttribute("wireFormat", getWireFormat());