Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
模板引擎,java实现,小巧 & 良好的性能,语法类似javascript,支持自定义函数,全局变量,Lambda表达式 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

Febit Wit

BSD License Build Status QQ Group: 302505483

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

How to use

  • Maven:
<dependency>
    <groupId>org.febit.wit</groupId>
    <artifactId>wit-core</artifactId>
    <version>2.0.0-beta</version>
</dependency>
  • or Gradle
compile 'org.febit.wit:wit-core:2.0.0-beta'
  • 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 = {
        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

Comments ( 0 )

Sign in for post a comment