Skip to content

Instantly share code, notes, and snippets.

@mcihad
Created May 3, 2017 10:41
Show Gist options
  • Save mcihad/7ab8afde90048ca9123c7b2521f0e744 to your computer and use it in GitHub Desktop.
Save mcihad/7ab8afde90048ca9123c7b2521f0e744 to your computer and use it in GitHub Desktop.
thymeleaf spring xml config
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:property-placeholder location="classpath:application.properties" />
<mvc:annotation-driven/>
<!--
<mvc:resources mapping="/resources/**" location="/resources/" />
-->
<bean class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver" id="templateResolver">
<property name="prefix" value="${template.prefix}"/>
<property name="suffix" value="${template.suffix}"/>
<property name="templateMode" value="${template.mode}"/>
<property name="cacheable" value="${template.cacheable}"/>
</bean>
<bean class="org.thymeleaf.spring4.SpringTemplateEngine" id="templateEngine">
<property name="templateResolver" ref="templateResolver"/>
</bean>
<bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver" id="viewResolver">
<property name="templateEngine" ref="templateEngine"/>
</bean>
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
<property name="basename" value="${message.basename}"/>
<property name="defaultEncoding" value="${message.encoding}"/>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment