try {
if (executePreEvaluationActions(request, response, context, path))
return;
// if the page is static
StaticResourceManager staticResourceManager = siteContext.getStaticResourceManager();
if (staticResourceManager.resourceExists(path)) {
if (outputStream != null) {
// execute the global actions
if (executeGlobalActions(request, response, context, path, allowRedirect))
return;
// execute path actions
if (executePathActions(request, response, context, path, allowRedirect))
return;
// execute parameter actions
if (executeParameterActions(request, response, context, path, allowRedirect))
return;
// load and return the static resource
staticResourceManager.load(path, outputStream);
outputStream.flush();
return;
} else {
throw new GeneralException("Cannot load static resource with a null OutputStream");
}