}
// This method should ONLY be called from include()
private void loadAndRenderIncludedTemplate(String templateName, boolean ignoreMissingFile) {
// Now load new template with given name.
Template template = null;
try {
template =
templateLoader.load(templateName, context.getResourceLoader(), context
.getAutoEscapeMode());
} catch (RuntimeException e) {
if (ignoreMissingFile && ExceptionUtil.isFileNotFoundException(e)) {
return;
} else {
throw e;
}
}
// Intepret loaded template.
try {
// TODO: Execute lincludes (but not includes) in a separate
// context.
template.render(context);
} catch (IOException e) {
throw new JSilverInterpreterException(e.getMessage());
}
}