Setting freemarker template from classpath

前端 未结 5 1781
野性不改
野性不改 2020-12-08 19:38

I have a web application that I need to manually obtain a Freemarker template - the template is obtained via a class in a library project, but the actual tpl file is contain

5条回答
  •  一整个雨季
    2020-12-08 20:16

    this is what ended up working for me:

    freemarkerConfiguration = new Configuration(Configuration.VERSION_2_3_28);
    freemarkerConfiguration.setClassForTemplateLoading(this.getClass(), "/");
    Template freemarkerTemplate = freemarkerConfiguration.getTemplate("email/vendor.tpl");
    

提交回复
热议问题