ECS(ElementConstructionSet)是一个用Java对象来生成HTML文档的工具包。
示例代码:
Html html = new Html() .addElement(new Head() .addElement(new Title("Demo"))) .addElement(new Body() .addElement(new H1("Demo Header")) .addElement(new H3("Sub Header:")) .addElement(new Font().setSize("+1") .setColor(HtmlColor.WHITE) .setFace("Times") .addElement("The big dog & the little cat chased each other.")));out.println(html.toString()); // or write to the outputstream directlyoutput(out);
评论