private final Date boot = Clock.now();
/** serve static resources, e.g. images and css that do not have any dynamic component */
private boolean serveStatic(String uri, HttpServletResponse res) throws IOException {
StaticResource staticResource = staticResourceLookup.findStaticResource(uri);
if (staticResource != null) {
if (staticResource.exists()) {
res.setHeader("Content-Type", staticResource.getMimeType());
res.setDateHeader("Date", boot.getTime());
HttpHeaders.addCacheForeverHeaders(res);
staticResource.copyTo(res.getOutputStream());
} else {
res.sendError(404);
log.warn("Requested resource not found: " + uri);
}
return true;