SpringBoot+thymeleaf出现SpelEvaluationException: EL1007E: Property or field ‘data‘ canno be found on n

今早打开昨天的项目,加了一个小功能,然后项目就崩了。主要是这个功能和这里一点关系都没有。
明明昨天晚上睡觉前都还好好的,今天一打开连首页都访问不了。崩溃。
花了一个多小时解决完这个问题,复盘错误时,把它还原成出错时的样子时它竟然又好了。我怀疑它在搞我心态。编程是门玄学问题。

来看看这个奇奇怪怪的bug吧

网页报错500
在这里插入图片描述
控制台:

```org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates//index.html]")

再看详细错误信息:

Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "map.user.headerUrl" (template: "/index" - line 123, col 12)
	at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393)
	at org.attoparser.MarkupParser.parse(MarkupParser.java:257)
	at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230)
	... 48 common frames omitted
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "map.user.headerUrl" (template: "/index" - line 123, col 12)
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'headerUrl' cannot be found on null

这是按照提示找到的index.html中出错的代码

<!-- 帖子列表 -->
			<ul class="list-unstyled">
				<li class="media pb-3 pt-3 mb-3 border-bottom" th:each="map:${discussPosts}">
					<a href="site/profile.html">
						<img th:src="${map.user.headerUrl}" class="mr-4 rounded-circle" alt="用户头像" style="
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值