Codota Logo
FreeMarkerRender.getConfiguration
Code IndexAdd Codota to your IDE (free)

How to use
getConfiguration
method
in
com.jfinal.render.FreeMarkerRender

Best Java code snippets using com.jfinal.render.FreeMarkerRender.getConfiguration (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: jfinal/jfinal

/**
 * Set freemarker's property.
 * The value of template_update_delay is 5 seconds.
 * Example: FreeMarkerRender.setProperty("template_update_delay", "1600");
 */
public static void setProperty(String propertyName, String propertyValue) {
  try {
    FreeMarkerRender.getConfiguration().setSetting(propertyName, propertyValue);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}
 
origin: jfinal/jfinal

public static void setProperties(Properties properties) {
  try {
    FreeMarkerRender.getConfiguration().setSettings(properties);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}
 
origin: jfinal/jfinal

/**
 * 注入对象到 FreeMarker 页面供调用,通常注入一些辅助内容输出的工具类,相当于是 freemarker 的一种扩展方式
 * @param name 对象名
 * @param object 对象
 */
public static void setSharedVariable(String name, Object object) {
  try {
    FreeMarkerRender.getConfiguration().setSharedVariable(name, object);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}
 
origin: com.jfinal/jfinal

/**
 * 注入对象到 FreeMarker 页面供调用,通常注入一些辅助内容输出的工具类,相当于是 freemarker 的一种扩展方式
 * @param name 对象名
 * @param object 对象
 */
public static void setSharedVariable(String name, Object object) {
  try {
    FreeMarkerRender.getConfiguration().setSharedVariable(name, object);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}
 
origin: com.github.sogyf/goja-jfinal

/**
 * Set freemarker's property.
 * The value of template_update_delay is 5 seconds.
 * Example: FreeMarkerRender.setProperty("template_update_delay", "1600");
 */
public static void setProperty(String propertyName, String propertyValue) {
  try {
    FreeMarkerRender.getConfiguration().setSetting(propertyName, propertyValue);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}

origin: com.jfinal/jfinal

/**
 * Set freemarker's property.
 * The value of template_update_delay is 5 seconds.
 * Example: FreeMarkerRender.setProperty("template_update_delay", "1600");
 */
public static void setProperty(String propertyName, String propertyValue) {
  try {
    FreeMarkerRender.getConfiguration().setSetting(propertyName, propertyValue);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}
 
origin: com.github.sogyf/goja-jfinal

public static void setProperties(Properties properties) {
  try {
    FreeMarkerRender.getConfiguration().setSettings(properties);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}
origin: com.jfinal/jfinal

public static void setProperties(Properties properties) {
  try {
    FreeMarkerRender.getConfiguration().setSettings(properties);
  } catch (TemplateException e) {
    throw new RuntimeException(e);
  }
}
 
origin: com.github.sogyf/goja-mvt

private static Configuration initStringConfiguration() {
  if (stringConfig == null) {
    //从freemarker 视图中获取所有配置
    stringConfig = (Configuration) FreeMarkerRender.getConfiguration().clone();
    stringLoader.putTemplate(UPDATE_RESPONSE_TEMPLATE, StringPool.EMPTY);
  }
  return stringConfig;
}
origin: com.github.sogyf/goja-mvt

/**
 * appConfig配置所有参数
 * 重写freemarker中的  reader方法,读取该配置文件
 *
 * @return config
 */
private static Configuration getAppConfiguration() {
  if (appConfig == null) {
    //从freemarker 视图中获取所有配置
    appConfig = (Configuration) FreeMarkerRender.getConfiguration().clone();
    try {
      //设置模板路径
      appConfig.setDirectoryForTemplateLoading(new File(PathKit.getWebRootPath() + Goja.viewPath));
      appConfig.setObjectWrapper(new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build());
    } catch (IOException e) {
      logger.error("The Freemarkers has error!", e);
    }
  }
  return appConfig;
}
origin: com.github.sogyf/goja-mvt

/**
 * set freemarker variable.
 */
private void setFtlSharedVariable() {
  // custmer variable
  final Configuration config = FreeMarkerRender.getConfiguration();
  config.setSharedVariable("block", new BlockDirective());
  config.setSharedVariable("extends", new ExtendsDirective());
  config.setSharedVariable("override", new OverrideDirective());
  config.setSharedVariable("super", new SuperDirective());
  // 增加日期美化指令(类似 几分钟前)
  config.setSharedVariable("prettytime", new PrettyTimeDirective());
  if (GojaConfig.enable_security()) {
    config.setSharedVariable("shiro", new ShiroTags(config.getObjectWrapper()));
  }
}
com.jfinal.renderFreeMarkerRendergetConfiguration

Javadoc

freemarker can not load freemarker.properies automatically

Popular methods of FreeMarkerRender

  • <init>
  • getDevMode
  • init
  • getContentType
    继承类可通过覆盖此方法改变 contentType,从而重用 freemarker 模板功能 例如利用 freemarker 实现 FreeMarkerXmlRender 生成 Xml 内容
  • getEncoding

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Kernel (java.awt.image)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now