728x90
<!-- thymeleaf -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
<version>2.1.4.RELEASE</version>
</dependency>
<!-- thymeleaf need servlet API for compiling the classes. Not needed in runtime -->
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
http://www.thymeleaf.org/doc/tutorials/2.1/thymeleafspring.html#views-and-view-resolvers-in-spring-mvc
<bean id="templateResolver"
class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">
<property name="suffix" value=".html" />
<property name="templateMode" value="HTML5" />
</bean>
<bean id="templateEngine"
class="org.thymeleaf.spring4.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
</bean>
<bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver">
<property name="templateEngine" ref="templateEngine" />
<property name="order" value="1" />
<property name="viewNames" value="*.html,*.xhtml" />
</bean>
<bean name="main" class="org.thymeleaf.spring4.view.ThymeleafView">
<property name="staticVariables">
<map>
<entry key="footer" value="Some company: <b>ACME</b>" />
</map>
</property>
</bean>
기본 뷰 위치
"classpath:resources/templates/"
반응형
'프로그래밍 TIP > Spring' 카테고리의 다른 글
Spring Boot 에서 Springloaded 사용하기 (2) | 2015.10.22 |
---|---|
이클립스 프로젝트 생성 후 초기화 (0) | 2015.01.06 |
Spring3.0 스케줄링 (8) | 2013.01.25 |