if (writer == null)
throw new GeneralException("Cannot load dynamic content with a null Writer");
// load the page
PageInstance pageInstance = siteContext.getPageManager().getPage(path);
Page page = new Page(pageInstance);
context.disableCheckReservedNames(this);
// expose the page in the context
context.put("page", page);
// expose components in the context
context.put("components", new ComponentMap(context));
if (siteContext.isProtectReservedNames()) {
context.enableCheckReservedNames(this);
}
// 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;
// execute the page actions
if (optionalRedirect(page.executeActions(context), path, response, allowRedirect))
return;
// get the template
Template template = siteContext.getTemplateManager().getTemplate(page.getFullTemplateName());
// merge the template
template.merge(context, page, writer);
writer.flush();
} catch (FileNotFoundException e) {