コード例 #1
0
ファイル: TemplateServlet.java プロジェクト: sjroot/Stencil
  /** 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;
  }
コード例 #2
0
ファイル: TemplateServlet.java プロジェクト: sjroot/Stencil
  @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();
    }
  }