Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »



pom.xml

<properties>
   <java-version>1.8</java-version>
   <org.springframework-version>4.2.9.RELEASE</org.springframework-version>
   <org.slf4j-version>1.6.6</org.slf4j-version>
   <handlebars-version>4.0.6</handlebars-version>
   <jackson.version>2.4.4</jackson.version>
</properties>


<dependencies>
	...
	<dependency>
	   <groupId>com.github.jknack</groupId>
	   <artifactId>handlebars</artifactId>
	   <version>${handlebars-version}</version>
	</dependency>
	<dependency>
	   <groupId>com.github.jknack</groupId>
	   <artifactId>handlebars-jackson2</artifactId>
	   <version>${handlebars-version}</version>
	</dependency>
	<dependency>
	   <groupId>com.github.jknack</groupId>
	   <artifactId>handlebars-springmvc</artifactId>
	   <version>${handlebars-version}</version>
	</dependency>
</dependencies>


spring mvc view resolver 설정

.hbs 확장자 view resolver 에 추가.

servlet-context.xml
<!-- handle bar: jdk 7 이상에서만 지원함 -->
<beans:bean class="com.github.jknack.handlebars.springmvc.HandlebarsViewResolver">
   <beans:property name="prefix" value="/WEB-INF/handlebars/"/>
   <beans:property name="suffix" value=".hbs"/>
</beans:bean>


테스트




Ref


  • No labels