Java thymeleaf文本模板中特殊字符的解析

Java thymeleaf文本模板中特殊字符的解析,java,spring-boot,thymeleaf,Java,Spring Boot,Thymeleaf,我正在使用Thymelead Text-Temaplate,并希望解析特殊字符,如单引号“&”等。我正在尝试像[#th:Text=“${'What's's up?}”/,但它抛出以下错误: ERROR a.c.s.d.o.h.c.SubmissionController - Exception evaluating OGNL expression: "'What''s up?'" (template: "sample-template" - line 63, col 4) org.thymele

我正在使用Thymelead Text-Temaplate,并希望解析特殊字符,如单引号“&”等。我正在尝试像
[#th:Text=“${'What's's up?}”/
,但它抛出以下错误:

ERROR a.c.s.d.o.h.c.SubmissionController - Exception evaluating OGNL expression: "'What''s up?'" (template: "sample-template" - line 63, col 4)
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating OGNL expression: "'What''s up?'" (template: "sample-template" - line 63, col 4)

你的代码很好。例如,这对我很有用:

<p th:inline="text">
    [# th:text="${'What''s up?'}" /]
</p>

[#th:text=“${”怎么了?}”/

Thymeleaf判断代码为文本的方式可能有问题。

请检查: