Boolean readonly = req.getParameter("readonly") != null
|| (Boolean)req.getAttribute("minima.readonly");
resp.setContentType("text/html");
SkimpyTemplate index = build.getPage("index");
index
.add("BOARD_TITLE", boardTitle)
.add("READ_ONLY", readonly.toString())
.add("WEBSOCKET_LOCATION", websocketLocation.equals("auto")
? "ws://" + req.getServerName() + ":" + req.getServerPort() + contextPath + "/websocket" : websocketLocation)
.add("DATA_LOCATION", contextPath + "/data")
.add("COMET_LOCATION", contextPath + "/comet")
.add("LOGIN_URL", contextPath + "/login")
.add("CLIENT_TAG", Utils.makeId())
.add("TEMPLATES", build.getTemplatesHtml());
if (req.getParameter("devel") != null) {
index
.add("CSS_IMPORTS", build.getDevelCssTags(contextPath))
.add("LIB_IMPORTS", build.getDevelLibsTags(contextPath))
.add("MAIN_IMPORTS", build.getDevelMainTags(contextPath));
}
else {
index
.add("CSS_IMPORTS", build.getProductionCssTag(contextPath))
.add("LIB_IMPORTS", build.getProductionLibsTag(contextPath))
.add("MAIN_IMPORTS", build.getProductionMainTag(contextPath));
}
PrintWriter writer = resp.getWriter();
index.write(writer);
writer.close();
}