6.1 th:text属性
可对表达式或变量求值,并将结果显示在其被包含的 html 标签体内替换原有html文本
文本连接:用“+”符号,若是变量表达式也可以用“|”符号
6.2 th:utext属性
e.g.
若home.welcome=Welcome to our <b>fantastic</b> grocery store!
用<p th:text="#{home.welcome}"></p>解析结果为:
Welcome to our <b>fantastic</b> grocery store!
解决方案
<p th:utext="#{home.welcome}"></p>即可。
Welcome to our fantastic grocery store!
等效于html :<p>Welcome to our <b>fantastic</b> grocery store!</p>