use of org.eclipse.jetty.server.LocalConnector in project jetty.project by eclipse.
the class AsyncContextTest method setUp.
@Before
public void setUp() throws Exception {
_server = new Server();
_connector = new LocalConnector(_server);
_connector.setIdleTimeout(5000);
_connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
_server.addConnector(_connector);
_contextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
_contextHandler.setContextPath("/ctx");
_contextHandler.addServlet(new ServletHolder(new TestServlet()), "/servletPath");
_contextHandler.addServlet(new ServletHolder(new TestServlet()), "/path with spaces/servletPath");
_contextHandler.addServlet(new ServletHolder(new TestServlet2()), "/servletPath2");
_contextHandler.addServlet(new ServletHolder(new TestStartThrowServlet()), "/startthrow/*");
_contextHandler.addServlet(new ServletHolder(new ForwardingServlet()), "/forward");
_contextHandler.addServlet(new ServletHolder(new AsyncDispatchingServlet()), "/dispatchingServlet");
_contextHandler.addServlet(new ServletHolder(new ExpireServlet()), "/expire/*");
_contextHandler.addServlet(new ServletHolder(new BadExpireServlet()), "/badexpire/*");
_contextHandler.addServlet(new ServletHolder(new ErrorServlet()), "/error/*");
ErrorPageErrorHandler error_handler = new ErrorPageErrorHandler();
_contextHandler.setErrorHandler(error_handler);
error_handler.addErrorPage(500, "/error/500");
error_handler.addErrorPage(IOException.class.getName(), "/error/IOE");
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[] { _contextHandler, new DefaultHandler() });
_server.setHandler(handlers);
_server.start();
}
use of org.eclipse.jetty.server.LocalConnector in project jetty.project by eclipse.
the class PostServletTest method startServer.
@Before
public void startServer() throws Exception {
complete = new CountDownLatch(1);
ex0.set(null);
ex1.set(null);
posted.set(false);
server = new Server();
connector = new LocalConnector(server);
server.addConnector(connector);
ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/");
context.addServlet(BasicReadPostServlet.class, "/post");
server.setHandler(context);
server.start();
}
Aggregations