LOG.severe("No valid http end point address provided!");
}
for (Connector connector : connectors) {
httpServer.addConnector(connector);
}
final WebAppContext context = new WebAppContext();
context.setParentLoaderPriority(true);
if (jettySessionManager != null) {
// This disables JSessionIDs in URLs redirects
// see: http://stackoverflow.com/questions/7727534/how-do-you-disable-jsessionid-for-jetty-running-with-the-eclipse-jetty-maven-plu
// and: http://jira.codehaus.org/browse/JETTY-467?focusedCommentId=114884&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-114884
jettySessionManager.setSessionIdPathParameterName(null);
context.getSessionHandler().setSessionManager(jettySessionManager);
}
final ResourceCollection resources = new ResourceCollection(resourceBases);
context.setBaseResource(resources);
addWebSocketServlets();
try {
final Injector parentInjector = injector;
final ServletModule servletModule = getServletModule(parentInjector);
ServletContextListener contextListener = new GuiceServletContextListener() {
private final Injector childInjector = parentInjector.createChildInjector(servletModule);
@Override
protected Injector getInjector() {
return childInjector;
}
};
context.addEventListener(contextListener);
context.addFilter(GuiceFilter.class, "/*", EnumSet.allOf(DispatcherType.class));
context.addFilter(GzipFilter.class, "/webclient/*", EnumSet.allOf(DispatcherType.class));
httpServer.setHandler(context);
httpServer.start();
restoreSessions();