HTTL版Hello World
阿新 • • 發佈:2018-03-09
httl
<dependency>
<groupId>com.github.httl</groupId>
<artifactId>httl</artifactId>
<version>1.0.11</version>
</dependency>
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import httl.Engine;
import httl.Template;
public static void main(String[] args) throws ParseException { String str = "hello,${name}"; Map<String, Object> params = new HashMap<>(); params.put("name", "httl"); Engine engine = Engine.getEngine(); Template template = engine.parseTemplate(str); String result = (String) template.evaluate(params); System.out.printf(result); }
HTTL版Hello World