Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Java 模板引擎,基于java 5 开发,不依赖其他第三方库,弱类型,语法类似于Javascript spread retract

http://zqq90.github.io/webit-script/

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Webit Script

QQ群: 302505483 Bitdeli Badge Build Status

This is a template engine, all writen in Java, support Java 5+.

Maven

<dependency>
  <groupId>com.github.zqq90.webit-script</groupId>
  <artifactId>webit-script</artifactId>
  <version>1.4.0</version>
</dependency>

Yeah, only one jar

webit-script-*.jar <400KB

How to use

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

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

Official Support

  • Jodd Madvoc
  • JFinal
  • Spring MVC
  • Struts2
  • Servlet & Filter

Demo

Performance(性能)

by 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 for details.

Webit Script 依据 BSD许可证发布。详细请看 LICENSE 文件。

Third-party Licenses

Bug report

github-issue OSC-issue

Comments ( 0 )

Sign in for post a comment