logger.info("Precompiling java server pages for '{}'", site);
int errorCount = 0;
Iterator<URL> rendererIterator = rendererUrls.iterator();
while (keepGoing && rendererIterator.hasNext()) {
MockHttpServletResponse response = new MockHttpServletResponse();
URL entry = rendererIterator.next();
String path = entry.getPath();
String pathInfo = path.substring(path.indexOf(site.getIdentifier()) + site.getIdentifier().length());
request.setPathInfo(pathInfo);
request.setRequestURI(pathInfo);
request.setAttribute(WebloungeRequest.PAGE, page);
request.setAttribute(WebloungeRequest.COMPOSER, page.getComposer(PageTemplate.DEFAULT_STAGE));
if (pagelet != null)
request.setAttribute(WebloungeRequest.PAGELET, pagelet);
try {
logger.debug("Precompiling {}:/{}", site, pathInfo);
servlet.service(request, response);
switch (response.getStatus()) {
case HttpServletResponse.SC_OK:
logger.debug("Precompilation of {}:/{} finished", site, pathInfo);
break;
case SC_NOT_FOUND:
logger.error("Precompilation failed: {}:/{}: not found", site, pathInfo);
break;
default:
logger.debug("Precompilation of {}:/{} failed with status {}", new Object[] {
site,
pathInfo,
response.getStatus() });
break;
}
} catch (Throwable t) {
while (t != t.getCause() && t.getCause() != null)
t = t.getCause();