视图解析器
<!-- Thymeleaf视图解析器-->
<bean class="org.thymeleaf.spring5.view.ThymeleafViewResolver"> <property name="order" value="1"></property> <property name="characterEncoding" value="uft-8"/> <property name="templateEngine" > <bean class="org.thymeleaf.spring5.SpringTemplateEngine"> <property name="templateResolver"> <bean class="org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver"> <property name="prefix" value="/"></property> <property name="suffix" value=".html"></property> <property name="characterEncoding" value="utf-8"></property> <property name="templateMode" value="HTML5"></property> </bean> </property> </bean> </property> </bean>
<!-- ViewResolver视图解析器-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="order" value="2"/>
<property name="prefix" value="/"></property>
<property name="suffix" value=".jsp"></property>
</bean>