Exception evaluating SpringEL expression:

Exception evaluating SpringEL expression:错误

说明:

在帮助同事看BUG的时候遇上了这个问题,不知道是前端还是后端的错误

在网上找了很多文章解决的方法,很多都没啥作用

不过慢慢找着百度还是被我找到了解决的方法

转载自:http://www.bubuko.com/infodetail-2594317.html

错误信息:

Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "username" (template: "userEdit" - line 18, col 87)

控制台报错抛出这种错误

前端的表达式可能你去值是这样

<input type="password" class="form-control" name="password" id="password" th:value="${password}"
       placeholder="password"/>

解决方案:

//改成下面
th:value="#{password}"

就解决了

大家可以在评论上进行评论,一起解决bug

原文地址:https://www.cnblogs.com/liujunwei/p/11721066.html