1.示例
<p th:if="${#fields.hasErrors(‘name‘)}" th:errors="*{name}" ></p>
关键代码${#fields.hasErrors(‘name‘)}
name为提示所对应的变量
Spring 视图层如何显示验证消息提示
原文:https://www.cnblogs.com/max-hou/p/11104678.html