# webit-script **Repository Path**: imkarl/webit-script ## Basic Information - **Project Name**: webit-script - **Description**: Java 模板引擎,基于java 5 开发,不依赖其他第三方库,弱类型,语法类似于Javascript - **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**: 2014-08-11 - **Last Updated**: 2020-12-19 ## 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.4.0 ~~~~~ ## Yeah, only one jar > `webit-script-*.jar` *<400KB* ## How to use ~~~~~java Engine engine = Engine.createEngine("/webit-script-config.props", extraSettingsMap); Template template = engine.getTemplate("/your/template/path/filename.ext"); template.merge(parametersMap, outputStream); //template.merge(parametersMap, writer); ~~~~~ ## Hello Webit Script ~~~~~javascript Hello Webit Script! <% var books; { for(book : books){ %> ${for.iter.index}.《${book.name}》 ¥${book.price} <% } } { //this is a function var func = function(a, b){ return a + b + arguments[3]; }; echo func("a", "b", "c"); echo '\n'; } { 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] ## Performance(性能) > by [zqq90/ebm][zqq90_ebm] ~~~~~ Engine Time JetbrickTemplate-1.0.0 6532 HTTL-1.0.11 6690 BSL-2.0.2 8801 WebitScript-1.2.0 8956 DirectOut-system 11519 BeeTL-1.25.01 11603 Rythm-1.0.0-b10-SNAPSHOT 12671 Velocity-1.7 24075 FreeMarker-2.3.19 32546 ~~~~~ ## License **Webit Script** is released under the BSD License. See the bundled [LICENSE file][license] for details. > **Webit Script** 依据 BSD许可证发布。详细请看 [LICENSE][license] 文件。 ## Third-party Licenses + **Jodd** under the BSD License. [License file][jodd_license] + **ASM-3.3.1** under the BSD License.[License file][asm_license] ## Bug report > [github-issue][new_issue_github] > [OSC-issue][new_issue_osc] [zqq90_ebm]: https://github.com/zqq90/ebm [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