protected static boolean templateExists(String templateName) { try { TemplateLoader.load(template(templateName)); return true; } catch (TemplateNotFoundException ex) { return false; } }
/** * Render the template corresponding to the action's package-class-method name (@see <code>template()</code>). * * @param args * The template data. */ protected static void renderTemplate(Map<String, Object> args) { renderTemplate(template(), args); }
/** * Render the corresponding template (@see <code>template()</code>). * * @param args * The template data */ protected static void render(Object... args) { String templateName = null; if (args.length > 0 && args[0] instanceof String && LocalVariablesNamesTracer.getAllLocalVariableNames(args[0]).isEmpty()) { templateName = args[0].toString(); } else { templateName = template(); } renderTemplate(templateName, args); }
templateBinding.put("errors", Validation.errors()); try { Template template = TemplateLoader.load(template(templateName)); throw new RenderTemplate(template, templateBinding.data); } catch (TemplateNotFoundException ex) {