Search in sources :

Example 1 with ToolUtil

use of com.ikoori.vip.server.core.util.ToolUtil in project vip by guangdada.

the class BeetlConfiguration method initOther.

@Override
public void initOther() {
    groupTemplate.registerFunctionPackage("shiro", new ShiroExt());
    groupTemplate.registerFunctionPackage("tool", new ToolUtil());
}
Also used : ToolUtil(com.ikoori.vip.server.core.util.ToolUtil)

Example 2 with ToolUtil

use of com.ikoori.vip.server.core.util.ToolUtil in project vip by guangdada.

the class GunsTemplateEngine method initBeetlEngine.

public void initBeetlEngine() {
    Properties properties = new Properties();
    properties.put("RESOURCE.root", "");
    properties.put("DELIMITER_STATEMENT_START", "<%");
    properties.put("DELIMITER_STATEMENT_END", "%>");
    properties.put("HTML_TAG_FLAG", "##");
    Configuration cfg = null;
    try {
        cfg = new Configuration(properties);
    } catch (IOException e) {
        e.printStackTrace();
    }
    ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader();
    groupTemplate = new GroupTemplate(resourceLoader, cfg);
    groupTemplate.registerFunctionPackage("tool", new ToolUtil());
}
Also used : ToolUtil(com.ikoori.vip.server.core.util.ToolUtil) Configuration(org.beetl.core.Configuration) ClasspathResourceLoader(org.beetl.core.resource.ClasspathResourceLoader) IOException(java.io.IOException) GroupTemplate(org.beetl.core.GroupTemplate) Properties(java.util.Properties)

Aggregations

ToolUtil (com.ikoori.vip.server.core.util.ToolUtil)2 IOException (java.io.IOException)1 Properties (java.util.Properties)1 Configuration (org.beetl.core.Configuration)1 GroupTemplate (org.beetl.core.GroupTemplate)1 ClasspathResourceLoader (org.beetl.core.resource.ClasspathResourceLoader)1