草庐IT

runtimeInstance

全部标签

java - OSGi 中的速度 : how to load templates from classpath

我正在使用Velocity模板引擎为OSGi开发一个应用程序。它非常适合通过文件加载器加载我的模板,但现在我必须在我的jar中实现这个模板并将其作为资源加载。我怎样才能让它发挥作用?我的代码:ve=newVelocityEngine();ve.setProperty(RuntimeConstants.RESOURCE_LOADER,"classpath");ve.setProperty("classpath.resource.loader.class",ClasspathResourceLoader.class.getName());ve.setProperty("classpath.