-
Notifications
You must be signed in to change notification settings - Fork 18
Home
- Here is the Japid User Guide
- Use Japid as a Generic Template Engine
- A page detailing the steps to port a classic Play! application to Using Japid: Porting-ZenContact-to-Japid
Note: Read the Play’s template language to understand the basic syntax of Japid, since Japid’s syntax is largely based on the Play’s syntax.
There is a detailed explanation of the Japid architecture and general usage in the download area: Japid.pdf. It is a little out of date and to be updated though.
Japid is a Java-based dynamic content rendering templates system that aims to deliver the fastest possible result.
It’s a generic template engine that can be used by any Java applications to render any Java objects. It also provides adapters specifically for the Play! Framework.
The main goal of Japid is for use in large and high traffic Play! bases web sites. To reach that goal, Japid transforms html based mark-up files to clean Java source code thus the rendering work can reach near raw Java speed.
The high-performance does not come at the cost of advanced features such as site-mesh like layout, tags, template inheritance, content caching, server-side include.
This document focuses on using the Japid module for the Play! Framework.
- templates are strongly typed. A template must declare the arguments it takes.
- transformed to Java for best possible performance.
- a clear Java object model for templates.
- expression language is plain Java.
- templates are precompiled to Java, with commandline tool integrated with play command
Some rough numbers:
Hand-written Java code: | 0.85X |
Velocity | 2X |
Freemarker: | 3X |
Play! rendering layer in Groovy | 4-12X |
When integrated in Play, Japid can help Japid deliver 2-3X more total throughput under load.
- No other EL than Java can be used in expressions.
- Action URL reverse lookup is weak.
Thanks go to the original Play authors for a well thought-out web framework for best development time productivity and run-time performance. Some of the code in this template engine is shamefully adapted from the Play code. The Jamon template engine proves
transforming templates to Java source code is possible and has inspired me to start this project.