zoukankan      html  css  js  c++  java
  • 问题:JFinal框架使用FreeMarker渲染视图报错

    本人用的是JFinal-3.4。

    问题描述:

      在JFinal框架中使用FreeMarker渲染视图时,报 Caused by: java.lang.ClassNotFoundException: freemarker.template.TemplateException

      

    解决办法:

      第一步:配置JFinal常量

    public void configConstant(Constants constants) {
      constants.setDevMode(true);
      // 由于JFinal-3.4 默认使用 ViewType.JFINAL_TEMPLATE,此时需要改为 ViewType.FREE_MARKER
      constants.setViewType(ViewType.FREE_MARKER);
    }

      第二步:引入freemarker-2.3.20依赖(如果不做此步操作,仍然会报同样的错误)【重点】

    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.20</version>
    </dependency>

    注:如果你不是使用的maven构建的项目的话,需手动下载freemarker-2.3.20.jar,并引入到项目中来。

     

  • 相关阅读:
    flash player over linux
    chmod 命令
    A*算法
    adb找不到设备
    ubuntu14.04安装wine以及国际版QQ
    linux man
    X-window
    linux file system
    linux command
    directUI
  • 原文地址:https://www.cnblogs.com/Jimc/p/9679488.html
Copyright © 2011-2022 走看看