Unable to find velocity template resources

后端 未结 12 1094
星月不相逢
星月不相逢 2020-11-29 20:11

Just a simple velocity standalone app based on maven structure. Here is the code snippet written in Scala to render the template helloworld.vm in ${basedi

12条回答
  •  独厮守ぢ
    2020-11-29 20:33

    I faced the similar problem with intellij IDEA. you can use this

     VelocityEngine ve = new VelocityEngine();
        Properties props = new Properties();
        props.put("file.resource.loader.path", "/Users/Projects/Comparator/src/main/resources/");
        ve.init(props);
    
        Template t = ve.getTemplate("helloworld.vm");
        VelocityContext context = new VelocityContext();
    

提交回复
热议问题