# webit-script **Repository Path**: gx0803/webit-script ## Basic Information - **Project Name**: webit-script - **Description**: 模板引擎,java实现,小巧 & 高性能,语法类似javascript,支持自定义函数,全局变量,Lambda表达式 - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: http://zqq90.github.io/webit-script/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 11 - **Created**: 2015-03-26 - **Last Updated**: 2022-06-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Webit Script ==== QQ群: 302505483 Bitdeli Badge Build Status This is a template engine, all writen in Java, **support Java 5+**. ## Maven ~~~~~xml com.github.zqq90.webit-script webit-script 1.5.2 ~~~~~ ## Yeah, only one jar > `webit-script-1.5.2.jar` *<290KB* ## How to use ~~~~~java Engine engine = Engine.create(); Template template = engine.getTemplate("/template.wit"); template.merge(params, out); ~~~~~ ## Hello Webit Script ~~~~~javascript Hello Webit Script! <% var books; { for(book : books){ %> ${for.iter.index}.《${book.name}》 ¥${book.price} <% } } { var func = function(a, b){ return a + b + arguments[3]; }; echo func("a", "b", "c"); } { var map = { 1: 1, "key2": "value2", 3: 2 + 1 }; map[5] = 2 + 3; for(key, value : map){ echo key + ":" +value + "\n"; } } %> ~~~~~ > [More examples][tests] ## Official Support + Jodd Madvoc + JFinal + Spring MVC + Struts2 + Servlet & Filter > [Demo][mvc-demo] ## License **Webit Script** is released under the BSD License. See the bundled [LICENSE file][license] for details. ## Third-party Licenses + **ASM** under the BSD License.[License file][asm_license] ## Bug report > [github-issue][new_issue_github] > [OSC-issue][new_issue_osc] [mvc-demo]: https://github.com/zqq90/webitscript-mvc-demo [tests]: https://github.com/zqq90/webit-script/tree/master/webit-script/src/test/resources/webit/script/test/tmpls [new_issue_github]: https://github.com/zqq90/webit-script/issues/new [new_issue_osc]: http://git.oschina.net/zqq90/webit-script/issues/new [license]: https://github.com/zqq90/webit-script/blob/master/LICENSE [jodd_license]: http://jodd.org/license.html [asm_license]: http://asm.ow2.org/license.html