<!-- SpringResourceTemplateResolver automatically integrates with Spring's own --> <!-- resource resolution infrastructure, which is highly recommended. --> <beanid="templateResolver" class="org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver"> <propertyname="prefix"value="/WEB-INF/templates/" /> <propertyname="suffix"value=".html" /> <!-- HTML is the default value, added here for the sake of clarity. --> <propertyname="templateMode"value="HTML" /> <!-- Template cache is true by default. Set to false if you want --> <!-- templates to be automatically updated when modified. --> <propertyname="cacheable"value="true" />
<!-- SpringTemplateEngine automatically applies SpringStandardDialect and --> <!-- enables Spring's own MessageSource message resolution mechanisms. --> <beanid="templateEngine" class="org.thymeleaf.spring6.SpringTemplateEngine"> <propertyname="templateResolver"ref="templateResolver" /> <!-- Enabling the SpringEL compiler can speed up execution in most --> <!-- scenarios, but might be incompatible with specific cases when --> <!-- expressions in one template are reused across different data types, so --> <!-- this flag is "false" by default for safer backwards compatibility. --> <propertyname="enableSpringELCompiler"value="true" /> </bean>
<beanclass="org.thymeleaf.spring6.view.ThymeleafViewResolver"> <propertyname="templateEngine"ref="templateEngine" /> <!-- NOTE 'order' and 'viewNames' are optional --> <propertyname="order"value="1" /> <!-- <property name="viewNames" value="*.html,*.xhtml" />--> <propertyname="characterEncoding"value="UTF-8"/> </bean>