Handlebars.java

Logic-less and semantic templates with Java


by Edgar Espina Theme by mattgraham

Prototype your web sites with Handlebars.java!

In this section you will learn to prototype web sites using the Handlebars.java Server!

Download

Just click here for download the file.

Usage

  java -jar handlebars-proto-1.0.0.jar [-option value]

The Java Runtime Environment must be installed. In case you don't have one installed already, you can download and install from here.

Options:

Starting the server

  java -jar handlebars-proto-1.0.0.jar -d site
site/home.hbs:
<html>
<body>
<ul>
 {{#blogs}}
 <li>{{name}}</li>
 {{/blogs}}
</ul>
</body>
</html>
Open a browser and type:
http://localhost:6780/home.hbs

So, is that all? No, the next section teach you how to add data to your templates.

Data Sets

By default the data file must match the template name and must be in the same directory.

You can specify a different data set by using thedataparameter in the url.
http://localhost:6780/home.hbs?data=path/home2

Thedataparameter is a file path without a file extension.

Error reporting

Handlebars.java errors are reported through a very nice HTML page.

Conclusion

The Handlebars.java Server is a nice tool for prototyping web sites.

Data can be provided in two very user friendly formats and it has an excellent error reporting tool, these two features make ideal Handlebars.java for web designers.

Cool, isn't?

Want to contribute?

Thank you, for reading the Handlebars.java blog.