越来越异常评估SpringEL表达式:错误在thymeleaf
问题描述:
我想要替换我的thymeleaf模板中的单引号(')字符。由于我们的编码是逃避到'
和客户端期望它是'
越来越异常评估SpringEL表达式:错误在thymeleaf
为了实现快速修复,我打算用一个空格替换所有出现的有效载荷中的单引号(')字符。但是,这样做,我收到以下错误:
Exception evaluating SpringEL expression:
我已经使用的替换表达式:
<th:block th:with="Description=${op.jpText('$.short_description')}">
<u_short_description th:text="${#strings.replace(Description,''',' ')}"></u_short_description>
</th:block>
任何帮助将高度赞赏。提前致谢!
答
应该
<th:block th:with="Description=${op.jpText('$.short_description')}">
<u_short_description th:text="${#strings.replace(Description,'''',' ')}" />
</th:block>
你是不是正确的逃逸单引号在replace
。
可能重复[如何在Thymeleaf中单引号(')转义](https://*.com/questions/43121788/how-to-escape-single-quote-in-thymeleaf) – Metroids