Skip to content

View processor implementation for Jersey to render Mustache templates

License

Notifications You must be signed in to change notification settings

trautonen/jersey-mustache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

View processor implementation for Jersey to render Mustache templates

Resources

License

Stars

Watchers

Forks

Packages

No packages published