2021-2-4学习笔记org.thymeleaf.TemplateEngine :Exception processing template “index“: An error happened

org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8080-exec-6] Exception processing template “index”: An error happened during template parsing

org.thymeleaf.TemplateEngine : 
[THYMELEAF][http-nio-8080-exec-6] Exception processing template "index": An error happened 
during template parsing (template: "class path resource [templates/index.html]")

今天遇到这个错误,在我form提交到url添加用户的时候,仔细检查过后发现controller部分没有问题,没有网上说的种种问题,后来仔细看报错日志发现;

rg.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "user.user_name" (template: "index" - line 75, col 17)

由此可以看出在index.html中是有通过thymeleaf传递的用户数据的,而添加用户返回这个页面之后没有传递对应的model对象,所以会报错,这个错误本身就是说thymeleaf没法正确的解析这个页面模型。网页的报错如下:
在这里插入图片描述

可以考虑是否需要传值的地方进行了传值,或者跳转到别的页面,或者用ajax传值不用form

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值