Skip to content
forked from febit/wit

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

License

Notifications You must be signed in to change notification settings

gx0803/webit-script

 
 

Repository files navigation

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.5.1</version>
</dependency>

Yeah, only one jar

webit-script-1.5.1.jar <300KB

How to use

Engine engine = Engine.create("/webit-script-config.props", extraSettings);
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(性能)

// Waiting update

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published