Velocity找不到.vm文件的问题

来源:互联网 发布:安卓php服务器汉化版 编辑:程序博客网 时间:2024/06/05 03:47

问题:

     出现unable to find the helloworld.vm 异常:

解决方案:

      不管是用VelocityEngine还是用Velocity在init之前都需要配置一下资源加载器。即在init方法之前加上一下两条语句:

         ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");

         ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());

就可以解决找不到vm文件的问题。

0 0
原创粉丝点击