ContextHandler context = new ContextHandler();
context.setContextPath(contextName);
// bind the jetty http handler with the context handler
if (isSessionSupport) {
// If we have sessions, we need two handlers.
HashSessionManager sessionManager = new HashSessionManager();
SessionHandler sessionHandler = new SessionHandler(sessionManager);
HashSessionIdManager idManager = new HashSessionIdManager();
sessionManager.setIdManager(idManager);
HandlerCollection hc = new HandlerCollection();
hc.addHandler(handler);
hc.addHandler(sessionHandler);
context.setHandler(hc);
} else {