<!-- SpringResourceTemplateResolver automatically integrates with Spring's own -->
<!-- resource resolution infrastructure, which is highly recommended. -->
<bean id="templateResolver"
class="org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver">
<property name="prefix" value="/WEB-INF/templates/" />
<property name="suffix" value=".html" />
<!-- HTML is the default value, added here for the sake of clarity. -->
<property name="templateMode" value="HTML" />
<!-- Template cache is true by default. Set to false if you want -->
<!-- templates to be automatically updated when modified. -->
<property name="cacheable" value="true" />
<property name="characterEncoding" value="UTF-8" />
</bean>
<!-- SpringTemplateEngine automatically applies SpringStandardDialect and -->
<!-- enables Spring's own MessageSource message resolution mechanisms. -->
<bean id="templateEngine"
class="org.thymeleaf.spring6.SpringTemplateEngine">
<property name="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. -->
<property name="enableSpringELCompiler" value="true" />
</bean>
<bean class="org.thymeleaf.spring6.view.ThymeleafViewResolver">
<property name="templateEngine" ref="templateEngine" />
<!-- NOTE 'order' and 'viewNames' are optional -->
<property name="order" value="1" />
<!-- <property name="viewNames" value="*.html,*.xhtml" />-->
<property name="characterEncoding" value="UTF-8"/>
</bean>
Thymeleaf在使用最新版本的框架时(Spring6 + SpringMVC 6 + Tomcat10 + JDK17 ),出现各种500错误,配置.xml