weixin_45657461 2020-08-21 16:05 采纳率: 11.1%
浏览 216

freemarker问题,shiro标签报错

图片说明
我使用shiro标签就报错

严重: 在路径为/4pl-site-cpc的上下文中,Servlet[springmvc]的Servlet.service()引发了具有根本原因的异常Request processing failed; nested exception is freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> shiro.hasPermission  [in template "admin/article/list.ftl" at line 130, column 51]

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 (print stack trace for 1 more):
==> @shiro.hasPermission name="admin:review"  [in template "admin/article/list.ftl" at line 130, column 49]
FreeMarker template error:
The following has evaluated to null or missing:
==> shiro.hasPermission  [in template "admin/article/list.ftl" at line 130, column 51]

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):
----------
==> @shiro.hasPermission name="admin:review"  [in template "admin/article/list.ftl" at line 130, column 49]
    #list page.content as article  [in template "admin/article/list.ftl" at line 97, column 25]
----------

Java stack trace (for programmers):
----------
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]

求大佬解答!!!

  • 写回答

1条回答 默认 最新

  • s4s5ss 2020-08-23 09:41
    关注

    根据错误提示,检查一下shiro.hasPermission对象是否为空,值也是否为空
    懒无药救混经验

    评论

报告相同问题?

悬赏问题

  • ¥15 用C语言写离散数学相关问题
  • ¥30 如何用python的GephiStreamer连接到gephi中,把Python和Gephi的具体操作过程都展示,重点回答Gephi软件的调试,以及如果代码的端口在浏览器中无法显示怎么处理
  • ¥15 ansys机翼建模肋参数
  • ¥15 Sumo软件无法运行
  • ¥15 如何在vscode里搭建stata的编辑环境?
  • ¥15 dify知识库创建问题
  • ¥15 如何用C#的chart画1000万个点不卡顿
  • ¥15 爬虫技术找到网上看过房源客户的电话
  • ¥20 代码:Python随机森林反演生物量数据处理问题
  • ¥15 Linux系统的命令行窗口回车变成了换行,无法执行命令了