- sch.addVirtualHosts(new String[] {
- ServerConstants.getApiHostName()
- });
- sch.addServlet(new ServletHolder(new GigiAPI()), "/*");
- return sch;
- }
+ HandlerList hl = new HandlerList();
+ hl.setHandlers(new Handler[] {
+ ch, chSecure
+ });
+ return hl;
+ }
+
+ private static ContextHandler generateGigiServletContext(ServletHolder webAppServlet) {
+ final ResourceHandler rh = generateResourceHandler();
+ rh.setResourceBase("static/www");
+
+ HandlerWrapper hw = new PolicyRedirector();
+ hw.setHandler(rh);
+
+ ServletContextHandler servlet = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ servlet.setInitParameter(SessionManager.__SessionCookieProperty, "SomeCA-Session");
+ servlet.addServlet(webAppServlet, "/*");
+ ErrorPageErrorHandler epeh = new ErrorPageErrorHandler();
+ epeh.addErrorPage(404, "/error");
+ epeh.addErrorPage(403, "/denied");
+ servlet.setErrorHandler(epeh);
+
+ HandlerList hl = new HandlerList();
+ hl.setHandlers(new Handler[] {
+ hw, servlet
+ });
+
+ ContextHandler ch = new ContextHandler();
+ ch.setHandler(hl);
+ return ch;
+ }
+
+ protected static Handler generateStaticContext() {
+ final ResourceHandler rh = generateResourceHandler();
+ rh.setResourceBase("static/static");