jersey-mustache

View processor implementation for Jersey to render Mustache templates

License

License

Categories

Categories

Jersey Program Interface REST Frameworks
GroupId

GroupId

org.eluder.jersey
ArtifactId

ArtifactId

jersey-mustache
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

jersey-mustache
View processor implementation for Jersey to render Mustache templates
Project URL

Project URL

https://github.com/trautonen/jersey-mustache
Project Organization

Project Organization

Tapio Rautonen
Source Code Management

Source Code Management

https://github.com/trautonen/jersey-mustache

Download jersey-mustache

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
com.github.spullara.mustache.java : compiler jar 0.8.12
com.sun.jersey : jersey-core jar 1.17.1
com.sun.jersey : jersey-server jar 1.17.1
org.slf4j : slf4j-api jar 1.7.2

test (7)

Group / Artifact Type Version
junit : junit jar 4.11
com.sun.jersey.jersey-test-framework : jersey-test-framework-inmemory jar 1.17.1
com.sun.jersey : jersey-grizzly2-servlet jar 1.17.1
com.sun.jersey.contribs : jersey-guice jar 1.17.1
org.slf4j : slf4j-log4j12 jar 1.7.2
org.slf4j : jcl-over-slf4j jar 1.7.2
org.mockito : mockito-all jar 1.9.5

Project Modules

There are no modules declared in this project.

jersey-mustache

Build Status Coverage Status

View processor implementation for Jersey to render {{ mustache }} templates.

Maven artifacts

Release versions of jersey-mustache are available at the Central repository. Snapshots are available at the Sonatype OSS repository.

<dependency>
    <groupId>org.eluder.jersey</groupId>
    <artifactId>jersey-mustache</artifactId>
    <version>1.1.0-SNAPSHOT</version>
</dependency>

Configuration

If Jersey is configured to use classpath scanning for root resources and providers, only adding the jersey-mustache.jar to classpath is enough for enabling the provider. Mustache view processor can be also configured with init parameters in servlet container. When package scanning is used, com.sun.jersey.config.property.packages parameter must include org.eluder.jersey.mustache value.

  • mustache.file.root

    Defines the root folder in file system for mustache templates. If file or resource root is not defined, templates are loaded from the classpath root.

  • mustache.resource.root

    Defines the root resource folder in classpath for mustache templates. If file or resource root is not defined, templates are loaded from the classpath root.

  • mustache.factory.class

    Fully qualified name of a custom mustache factory implementation class. If file or resource root is defined, tries to initialize the factory with the corresponding constructor with String argument for resource root or File argument for file root, otherwise default constructor is used.

  • mustache.template.expiry

    Shorthand for defining reloading mustache factory with expiry time in milliseconds. This parameter will always ignore mustache.factory.class parameter. Template root parameters are honored.

Examples

Examples using embedded Grizzly servlet container are available in the test sources.

Dependencies

The only dependencies for jersey-mustache are Jersey and Mustache.java.

Continuous integration

Travis CI builds jersey-mustache with Oracle JDK 7. All successfully built snapshots are deployed to Sonatype OSS repository. Unit test code coverage is reported on every successfull build to Coveralls web service.

License

The project jersey-mustache is licensed under the MIT license.

Versions

Version
1.0.0