use of com.google.gitiles.GitilesServlet in project gitiles by GerritCodeReview.
the class DevServer method appHandler.
private Handler appHandler() {
DebugRenderer renderer = new DebugRenderer(STATIC_PREFIX, Arrays.asList(cfg.getStringList("gitiles", null, "customTemplates")), sourceRoot.resolve("gitiles-servlet/src/main/resources/com/google/gitiles/templates").toString(), firstNonNull(cfg.getString("gitiles", null, "siteTitle"), "Gitiles"));
String docRoot = cfg.getString("gitiles", null, "docroot");
Servlet servlet;
if (!Strings.isNullOrEmpty(docRoot)) {
servlet = createRootedDocServlet(renderer, docRoot);
} else {
servlet = new GitilesServlet(cfg, renderer, null, null, null, null, null, null, null);
}
ServletContextHandler handler = new ServletContextHandler();
handler.setContextPath("");
handler.addServlet(new ServletHolder(servlet), "/*");
return handler;
}
Aggregations