学无先后,达者为师

网站首页 编程语言 正文

Exception evaluating SpringEL expression异常处理

作者:爱纸 更新时间: 2022-08-19 编程语言

在运行项目时,控制台抛出异常Exception evaluating SpringEL expression,很明显这个异常时指向前端的

<tr>
            <td>1</td>
            <td th:text="${cloth.getCname()}"></td>
            <td th:text="${cloth.getEbrand()}"></td>
            <td th:text="${cloth.getCgender()}"></td>
            <td th:text="${detail.getDcolor()}"></td>
            <td th:text="${detail.getDprice()}"></td>
            <td th:text="${detail.getDsize()}"></td>
        </tr>

可以看出,使用thymeleaf的语法并没有问题,所以我们考虑是该cloth对象除了问题,我们回到后端,查看sql语句

发现查询并没有查出数据,在controller将cloth对象输出,也显示为null 

 总结可以的处该异常的原因就是因为EL表达式中的cloth对象为空造成的

 

原文链接:https://blog.csdn.net/m0_71890428/article/details/126291069

栏目分类
最近更新