Cross Java and Javascript Template Language?

前端 未结 1 1406
庸人自扰
庸人自扰 2020-12-31 16:10

There seem to be a lot of template languages for both Java (e.g. JSP, JSTL, Freemarker, Velocity, ...) and for Javascript (e.g. Mustache, Ext\'s XTemplate, Jquery templates,

1条回答
  •  感情败类
    2020-12-31 16:59

    Google Closure/Soy templates.

    The Wikipedia Page for Web Templating Languages reveals another one: Casper.

    Both these solutions don't use a common template file which is directly evaluated in JS or Java. The template must first be compiled into an intermediate JS before evaluation on the client. (For Closure, this is fairly easy to do with ant and an included SoyToJsSrcCompiler.jar command line tool. Not sure about with Casper.)

    EDIT: Another possibility is Mustache, which does not require templates to be compiled.

    0 讨论(0)
提交回复
热议问题