4
Thymeleaf:連結-式として解析できませんでした
テンプレートで複数の値を連結しようとすると問題が発生します。ここのThymeleafによると、私は単にそれらを一緒に+できるはずです... 4.6テキストの連結 テキストは、リテラルであるか、変数またはメッセージ式を評価した結果であるかに関係なく、+演算子を使用して簡単に連結できます。 th:text="'The name of the user is ' + ${user.name}" これが私がうまくいったものの例です: <p th:text="${bean.field} + '!'">Static content</p> ただし、これはしません。 <p th:text="${bean.field} + '!' + ${bean.field}">Static content</p> 論理的には、これは機能するはずですが、機能しません。何が間違っているのでしょうか。 Maven: <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring3</artifactId> <version>2.0.16</version> <scope>compile</scope> </dependency> TemplateEngineとTemplateResolverを設定する方法は次のとおりです。 <!-- Spring config --> <bean id="templateResolver" class="org.thymeleaf.templateresolver.ClassLoaderTemplateResolver"> <property name="suffix" value=".html"/> <property name="templateMode" value="HTML5"/> <property name="characterEncoding" …