What is the functional structure of templates for JavaScript and Grails / Java?

I am currently studying framework templates that implement both JavaScript and Grails / Java for the upcoming project, which will display the templates both in the Grails application and on the front side.

The requirements are as follows:

  • JavaScript and Grails / Java implementation
  • front-end and back-end rendering outputs the same output, given the same JSON data
  • easy for the author and support by the development team
  • can be checked both on the interface and on the interface
  • can handle nested JSON objects without too much trouble.
  • XSS protection on the interface

So far I have researched Mustache , which implements JavaScript and Java, and Haml , which has an implementation of JavaScript and Grails. (I would link implementations, but as a new user, I can only add 2 links.)

I would be grateful for any experience gained by others, and any recommendations for other structures that may meet the above requirements.

+6
java javascript grails mustache haml
source share
3 answers

Have you looked at Closure Templates ? There is also a Grails plugin . It meets most, if not all of your requirements.

+1
source share

At some point, I used Mustache and Hamla. If you hadnโ€™t mentioned this, I would probably recommend Mustache as a clean template solution. Haml is great, but it replaces author html anymore (i.e. you no longer write html, you write haml). Mustache on the other hand is all about patterns.

I think that any of them would be a great choice. Mustache.js is mature, the java implementation is probably not the case, but it has been around for a while, so you are probably fine. I'm not sure how mature javascript or grails Haml implementations are.

I would be inclined to Mustache, if all you need is a template, this is very good, although it takes some time to get used to the whole syntax {{}}. But if you are attracted to Haml as a substitute for writing HTML, it may tip you in that direction.

+1
source share

ExtJS has a complete widget library with which you can create an application. It works great with Grails as a JSON data provider.

0
source share

All Articles