org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression

前言

本文中提到的解决方案,源码地址在:springboot-thymeleaf,希望可以帮你解决问题。

本文中涉及的两个异常为我开发时遇到的,可能和你目前所要处理的bug不同,如果不是同一个问题,希望再找找其他文章。

异常

Exception evaluating SpringEL expression这个异常的出现应该有很多原因引起,本文中涉及的两个异常分别为:

  • org.springframework.expression.spel.SpelEvaluationException: EL1004E: Method call: Method service() cannot be found on com.my.blog.springboot.thymeleaf.util.MethodTest type
  • org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method test() on null context object

解决方案

  • 异常1 :
Attempted to call method on null context object

调用的方法处于一个空对象中,即调用实例为空。

解决方案可以参考我的这篇文章:Method call: Attempted to call method test() on null context object

  • 异常2 :
Method cannot be found

方法不存在

解决方案可以参考我的这篇文章:Method service() cannot be found on com.my.blog.springboot.thymeleaf.util.MethodTest type

859549-20170915174624610-265059040.jpg

转载于:https://www.cnblogs.com/han-1034683568/p/7527772.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值