html文件中thymeleaf提示${xxx.xx}无法解析:Validates unresolved references and invalid expressions

您所在的位置:网站首页 springboot项目html放哪 html文件中thymeleaf提示${xxx.xx}无法解析:Validates unresolved references and invalid expressions

html文件中thymeleaf提示${xxx.xx}无法解析:Validates unresolved references and invalid expressions

#html文件中thymeleaf提示${xxx.xx}无法解析:Validates unresolved references and invalid expressions| 来源: 网络整理| 查看: 265

1.路径错误

在controller中返回路径中多加了“/”

正确:return “site/login”;

错误:return “/site/login”;

2.因为controller中定义的Map是Object类型,无法调用Object的getName()方法

chontroller中:Map map

idea在解析时会去Object类找getName方法,找不到所以无法解析。但是项目运行时最后调用的是实体类的方法,所以虽然提示报错,但是可以正常运行。

可以通过model传数据时候不放object类,放具体的实体类。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3