connector.setSoLingerTime(0);
Server server = new Server();
server.addConnector(connector);
WebAppContext webContext = new WebAppContext();
webContext.setWar(appRootDir.getCanonicalPath());
webContext.setParentLoaderPriority(true);
webContext.setContextPath("/");
webContext.setClassLoader(Thread.currentThread().getContextClassLoader());
webContext.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
server.setHandler(webContext);
if (addDevelopmentComponents)
{
webContext.addFilter(DeclarativeUIFilter.class, "*.html", EnumSet.allOf(DispatcherType.class));
webContext.addServlet(ViewTester.class, "/viewTester/*");
if (!webContext.getInitParams().containsKey(DevModeInitializerListener.OUTPUT_CHARSET))
{
webContext.setInitParameter(DevModeInitializerListener.OUTPUT_CHARSET, pageOutputCharset);
}
webContext.addEventListener(new InitializerListener());
webContext.addEventListener(new DevModeInitializerListener());
}
try
{
server.start();
server.join();