Fork me on GitHub

Jade is the Node template language. jade4j is a Java implementation of the Jade template language specification.


1) Add the pippo-jade dependency to your pom.xml:


2) Start writing Jade templates in the templates folder of your application.

Note: The default file extension of a Jade template is .jade and it may be ommitted from your templates and your Pippo Java code.


This engine includes some useful Pippo integration features and conveniences like…


You can access your translation resources using the i18n method.


You can supply arguments to your MessageFormat translation resources too.

pippo.i18n("", "arg1", "arg2")
prettytime (relative time)

The pippo-jade supports automatically localized prettytime out-of-the-box and it is very easy to use.

Assuming you are providing a java.util.Date instance to prettyTime…


Will produce something like…

3 days ago

You can also automatically format localized dates using standard Java date format patterns.

pippo.formatTime(now, "short")
pippo.formatTime(now, "medium")
pippo.formatTime(now, "long")
pippo.formatTime(now, "full")
pippo.formatTime(now, "HH:mm")
pippo.formatTime(now, "dd-MM-yyyy HH:mm")
pippo.formatTime(now, "dd-MM-yyyy HH:mm")
webjarsAt & publicAt

The pippo-jade module supports context-aware url generation for your classpath resources using the webjarsAt and publicAt methods.

// Stylesheets
link(href=pippo.webjarsAt('bootstrap/3.3.1/css/bootstrap.min.css'), rel="stylesheet")
link(href=pippo.webjarsAt('font-awesome/4.2.0/css/font-awesome.min.css'), rel="stylesheet")
link(href=pippo.publicAt('css/style.css'), rel="stylesheet")

// Scripts

NOTE: Use of these methods require that you have registered a WebjarsResourceRoute and/or a PublicResourceRoute.

public class MyApplication extends Application {

    protected void onInit() {
        // add routes for static content
        // add other routes
Error Templates

The pippo-jade module will render special templates for routing problems and exceptions. You may override these templates within your own application (put a file with the same name, to same location, in your application classpath)

  • templates/pippo/404notFound.jade
  • templates/pippo/500interalError.jade