I am currently researching templating frameworks that have implementations for both JavaScript and Grails/Java for an upcoming project that will render templates both within a Grails application and on the front end.
The requirements are as follows:
- implementations in both JavaScript and Grails / Java
- front-end and back-end rendering produces the same output given the same JSON data
- straightforward to author and maintain by a team of developers
- testable on both front-end and back-end
- can handle nested JSON objects without too much trouble
- XSS protection on the front-end
So far, I have investigated Mustache which has JavaScript and Java implementations, and Haml which has JavaScript and Grails implementations. (I would link the implementations, but as a new user I am only able to add 2 links.)
I would be grateful for any experience others have had with these, and any recommendations for other frameworks that may fit the above needs.