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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM