本文整理汇总了Java中org.apache.velocity.runtime.resource.ResourceCacheImpl类的典型用法代码示例。如果您正苦于以下问题:Java ResourceCacheImpl类的具体用法?Java ResourceCacheImpl怎么用?Java ResourceCacheImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceCacheImpl类属于org.apache.velocity.runtime.resource包,在下文中一共展示了ResourceCacheImpl类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postProcessVelocityEngine
import org.apache.velocity.runtime.resource.ResourceCacheImpl; //导入依赖的package包/类
@Override
protected void postProcessVelocityEngine(VelocityEngine velocityEngine) {
super.postProcessVelocityEngine(velocityEngine);
velocityEngine.setProperty(RuntimeConstants.RESOURCE_LOADER, "webapp,file,class,url,jar,spring,springMacro");
velocityEngine.setProperty("webapp.resource.loader.class", WebappResourceLoader.class.getName());
velocityEngine.setProperty("file.resource.loader.class", FileResourceLoader.class.getName());
velocityEngine.setProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
velocityEngine.setProperty("url.resource.loader.class", URLResourceLoader.class.getName());
velocityEngine.setProperty("jar.resource.loader.class", JarResourceLoader.class.getName());
velocityEngine.setProperty("resource.manager.cache.class", ResourceCacheImpl.class.getName());
velocityEngine.setProperty("resource.manager.cache.size", 2048);
velocityEngine.setProperty("resource.manager.class", ResourceManagerImpl.class.getName());
velocityEngine.setProperty(RuntimeConstants.COUNTER_INITIAL_VALUE, 1);
velocityEngine.setProperty(RuntimeConstants.INPUT_ENCODING, inputEncoding);
velocityEngine.setProperty(RuntimeConstants.OUTPUT_ENCODING, outputEncoding);
velocityEngine.setProperty("contentType", contentType);
// org.apache.velocity.runtime.log.AvalonLogChute
// org.apache.velocity.runtime.log.Log4JLogChute
// org.apache.velocity.runtime.log.CommonsLogLogChute
// org.apache.velocity.runtime.log.ServletLogChute
// org.apache.velocity.runtime.log.JdkLogChute
velocityEngine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, new Log4JLogChute());
velocityEngine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_CACHE, true);
}