开发者社区> 问答> 正文

页面使用el表达式报错?报错

@JFinal 你好,想跟你请教个问题:我在页面用el表达式输出内容,为什么会报这个错误呀?已经引了freemarker的jar包了。

Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> document  [in template "document_list.jsp" at line 48, column 39]


Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??


The failing instruction (FTL stack trace):
----------
==> ${document.id}  [in template "document_list.jsp" at line 48, column 37]


展开
收起
爱吃鱼的程序员 2020-06-09 15:44:07 620 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

      设置一下使用freemarker模板:

    publicclassMyJFinalConfigextendsJFinalConfig{publicvoidconfigConstant(Constantsme){me.setViewType(ViewType.FREE_MARKER);}.....}

     其实默认就是freemarker不需要设置,只不过你给设置成了JSP而已:me.setViewType(ViewType.JSP);

    好的,解决了,谢谢波总
    2020-06-09 15:44:24
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载