-1
因此,这是交易。速度资源路径的问题
我正在使用Spring Framework开发预约应用程序。
一切都得不错我本地主机,甚至邮件发送部分。
但是当我通过这个项目对我weblogic的,则resource.loader.path属性出现不加载。
这里是我的代码的重要组成部分:
Properties prop = new Properties();
prop.setProperty("resource.loader", "class");
prop.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
prop.setProperty("class.resource.loader.path", "../jsp/email-templates");
VelocityEngine.init(prop);
Template template = VelocityEngine.getTemplate("user-response.jsp");
正如我所说的,只是我的代码的重要组成部分。基本上这样配置属性对象和VelocityEngine.getTemplate()加载上述文件夹内的user-response.jsp文件。
正如我所说的,在我的本地主机,他只是工作正常,但在weblogic出现这样:
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '..nulluser-response.jsp'
出于某种原因,class.resource.loader.path财产不加载weblogic。
那么......有人已经经历过这个问题?什么是错的任何想法?
实验值:这两个项目(本地主机和WebLogic)是相同的,使用版本控制软件(集市)
它不适合我。已经做到了:( – Alexandre 2013-04-22 16:57:08
是的,这意味着你不知道CLASSPATH是如何工作的。将Velocity JAR放入WEB-INF/lib中。 – duffymo 2013-08-02 10:02:31