View processor implementation for Jersey to render {{ mustache }} templates.
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>
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.
-
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.
-
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.
-
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 orFile
argument for file root, otherwise default constructor is used. -
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 using embedded Grizzly servlet container are available in the test sources.
- Simple servlet example using init parameters
- Guice Jersey integration with custom Mustache view processor
The only dependencies for jersey-mustache are Jersey and Mustache.java.
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.
The project jersey-mustache is licensed under the MIT license.