Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a handlebars.js implementation in java exist? [closed]

Currently I'm using Mustache templates ( http://mustache.github.com/ ) both on the client and server-side, using javascript and java implementation respectively.

However, there are some limitations in Mustache which the relatively new Handlebars.js ( http://www.handlebarsjs.com/ ) tries to overcome.

However as far as I see it handlebars only has a javascript implementation as of yet. Anyone knows of an (experimental) java-implementation of Handlebars?

like image 917
Geert-Jan Avatar asked Sep 15 '11 11:09

Geert-Jan


People also ask

What is handlebar in Java?

Handlebars is a templating engine. It means that given some template text and corresponding data, Handlebars generates a document with the data inserted at the positions in the template. E.g. Template: <h1>Hello {{name}}!</h1> Data: {

How handlebars js is different from mustache js?

Handlebars. js is an extension to the Mustache templating language created by Chris Wanstrath. Handlebars. js and Mustache are both logicless templating languages that keep the view and the code separated like we all know they should be; Mustache: Logic-less templates.

How do handlebars work?

Handlebars is a simple templating language. It uses a template and an input object to generate HTML or other text formats. Handlebars templates look like regular text with embedded Handlebars expressions. A handlebars expression is a {{ , some contents, followed by a }} .

How do you escape handlebars?

Escaping Handlebars expressions Handlebars content may be escaped in one of two ways, inline escapes or raw block helpers. Inline escapes created by prefixing a mustache block with \ .


2 Answers

I just saw this one pop up : https://github.com/jknack/handlebars.java which was originally here: https://github.com/edgarespina/handlebars.java (update your maven dependencies as the projects group id has changed also).

I have not tested it yet.

like image 120
Marc Avatar answered Oct 19 '22 07:10

Marc


I've not seen a Java implementation of handlebars as yet. Handlebars was originally developed by Yehuda Katz, predominantly a Ruby and JavaScript developer hence the JavaScript and Ruby implementations of it. Handlebars is an extension of the mustache syntax and thus not part of the mustache standard.

like image 33
JamieD Avatar answered Oct 19 '22 07:10

JamieD