String template = "<html>" + "<head><title>$title</title></head>" + "<body>" + "<h1>$heading</h1>" + "<p>$content</p>" + "</body>" + "</html>"; Engine engine = new Engine(); engine.registerTemplate("myTemplate", template); Context context = new Context(); String output = engine.evaluateTemplate("myTemplate", context); System.out.println(output);


上一篇:
下一篇:
切换中文