15 Star 42 Fork 10

febit / wit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.01 KB
一键复制 编辑 原始数据 按行查看 历史
febit 提交于 2018-10-05 00:12 . fix typos

Febit Wit

BSD License Build Status QQ Group: 302505483

This is a template engine, all written in Java, support Java 8+.

How to use

  • Maven:
<dependency>
    <groupId>org.febit.wit</groupId>
    <artifactId>wit-core</artifactId>
    <version>2.6.0</version>
</dependency>
  • or Gradle
compile 'org.febit.wit:wit-core:2.6.0'
  • demo:
Engine engine = Engine.create();
Template template = engine.getTemplate("/demo.wit");
template.merge(params, out);

Hello Wit

Hello Wit!
<%
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 = {
        books,
        1: 1,
        "key2": "value2",
        3: 2 + 1
    }
    map[5] = 2 + 3
    map.~put("6", 2*3)
    for(key, value : map){
        echo key + ":" +value + "\n"
    }
}
%>

More examples

Official Support

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

Demo

License

Febit Wit is released under the BSD License. See the bundled LICENSE file for details.

Third-party Licenses

Bug report

github-issue

Java
1
https://gitee.com/zqq90/webit-script.git
git@gitee.com:zqq90/webit-script.git
zqq90
webit-script
wit
master

搜索帮助