예제 #1
0
  /**
   * Invoked on startup. Looks for a single FreeMarkerConfig bean to find the relevant Configuration
   * for this factory.
   *
   * <p>Checks that the template for the default Locale can be found: FreeMarker will check
   * non-Locale-specific templates if a locale-specific one is not found.
   *
   * @see freemarker.cache.TemplateCache#getTemplate
   */
  protected void initApplicationContext() throws BeansException {
    super.initApplicationContext();

    if (getConfiguration() == null) {
      FreeMarkerConfig config = autodetectConfiguration();
      setConfiguration(config.getConfiguration());
    }
    checkTemplate();
  }
예제 #2
0
  /**
   * Invoked on startup. Looks for a single VelocityConfig bean to find the relevant VelocityEngine
   * for this factory.
   */
  protected void initApplicationContext() throws BeansException {
    super.initApplicationContext();

    if (getVelocityEngine() == null) {
      // No explicit VelocityEngine: try to autodetect one.
      setVelocityEngine(autodetectVelocityEngine());
    }

    checkTemplate();
  }