Ejemplo n.º 1
0
  /** Gets the current template, reloading if {@link TemplateOptions#isDevelopmentMode()} is set. */
  protected Template getTemplate() throws ServletException {
    if (template != null && !templateOptions.isDevelopmentMode()) {
      return template;
    }

    template = loadTemplate();
    return template;
  }
Ejemplo n.º 2
0
  @Override
  public void init() throws ServletException {
    templateOptions = getTemplateOptions();

    // If the options specify to eagerly load the template, load it now
    // before it has been requested.
    if (templateOptions.isEagerLoading()) {
      getTemplate();
    }
  }