mustache spring view

a spring view for the mustache templating language http://mustache.github.com/

License

License

GroupId

GroupId

com.github.sps.mustache
ArtifactId

ArtifactId

mustache-spring-view
Last Version

Last Version

1.4
Release Date

Release Date

Type

Type

jar
Description

Description

mustache spring view
a spring view for the mustache templating language http://mustache.github.com/
Project URL

Project URL

http://github.com/sps/mustache-spring-view
Source Code Management

Source Code Management

http://github.com/sps/mustache-spring-view

Download mustache-spring-view

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.sps.mustache/mustache-spring-view/ -->
<dependency>
    <groupId>com.github.sps.mustache</groupId>
    <artifactId>mustache-spring-view</artifactId>
    <version>1.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.sps.mustache/mustache-spring-view/
implementation 'com.github.sps.mustache:mustache-spring-view:1.4'
// https://jarcasting.com/artifacts/com.github.sps.mustache/mustache-spring-view/
implementation ("com.github.sps.mustache:mustache-spring-view:1.4")
'com.github.sps.mustache:mustache-spring-view:jar:1.4'
<dependency org="com.github.sps.mustache" name="mustache-spring-view" rev="1.4">
  <artifact name="mustache-spring-view" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.sps.mustache', module='mustache-spring-view', version='1.4')
)
libraryDependencies += "com.github.sps.mustache" % "mustache-spring-view" % "1.4"
[com.github.sps.mustache/mustache-spring-view "1.4"]

Dependencies

provided (8)

Group / Artifact Type Version
com.samskivert : jmustache jar 1.9
com.github.spullara.mustache.java : compiler jar 0.8.14
org.springframework : spring-webmvc jar 4.0.3.RELEASE
org.springframework : spring-web jar 4.0.3.RELEASE
org.springframework : spring-context jar 4.0.3.RELEASE
org.springframework : spring-core jar 4.0.3.RELEASE
org.springframework : spring-beans jar 4.0.3.RELEASE
javax.servlet : servlet-api jar 2.4

test (2)

Group / Artifact Type Version
junit : junit jar 4.11
org.mockito : mockito-core jar 1.9.0

Project Modules

There are no modules declared in this project.

Mustache.js View for Spring Web MVC

Supports both jmustache and mustache.java

Build Status Coverage Status

Maven Dependency

<dependency>
    <groupId>com.github.sps.mustache</groupId>
    <artifactId>mustache-spring-view</artifactId>
    <version>1.3</version>
</dependency>

<!-- jmustache -->
<dependency>
    <groupId>com.samskivert</groupId>
    <artifactId>jmustache</artifactId>
    <version>${jmustache.version}</version>
</dependency>

<!-- mustache.java -->
<dependency>
	<groupId>com.github.spullara.mustache.java</groupId>
    <artifactId>compiler</artifactId>
    <version>${mustache.java.version}</version>
</dependency>

Spring Configuration

<!-- jmustache -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.mustache.MustacheViewResolver">
    <property name="suffix" value=""/>
    <property name="cache" value="${TEMPLATE_CACHE_ENABLED}" />
    <property name="templateFactory">
        <bean class="org.springframework.web.servlet.view.mustache.jmustache.JMustacheTemplateFactory">
            <property name="escapeHTML" value="true"/>
            <property name="standardsMode" value="false"/>
            <property name="templateLoader">
                <bean class="org.springframework.web.servlet.view.mustache.jmustache.JMustacheTemplateLoader"/>                                
            </property>
        </bean>
    </property>
</bean>

<!-- mustache.java -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.mustache.MustacheViewResolver">
    <property name="suffix" value=""/>
    <property name="cache" value="${TEMPLATE_CACHE_ENABLED}"/>
    <property name="templateFactory">
        <bean class="org.springframework.web.servlet.view.mustache.java.MustacheJTemplateFactory" />
    </property>
</bean>

Localization Support

<bean id="messageSource" .../>

<!-- using mustache.java -->
<bean id="i18nMessageInterceptor"
      class="org.springframework.web.servlet.view.mustache.java.LocalizationMessageInterceptor">
    <property name="localeResolver" ref="..." />
</bean>

<!-- using jmustache -->
<bean id="i18nMessageInterceptor" class="org.springframework.web.servlet.view.mustache.jmustache.LocalizationMessageInterceptor">
    <property name="localeResolver" ref="..." />
</bean>

Thanks

Thanks to Eric White for forking this code base and providing the mustache.java implementation.

Versions

Version
1.4
1.3
1.2
1.1.2
1.1.1
1.1
1.0