HTML生成Java类库 ECS
fmms
13年前
<p>ECS (<strong>Element Construction Set</strong>) 是一个用 Java 对象来生成 HTML 文档的工具包。</p> <p>示例代码:</p> <p><img border="0" hspace="0" alt="" src="https://simg.open-open.com/show/56398e76be6355ad5999b262208a17c9.gif" width="1" height="1" /></p> <pre class="brush:java; toolbar: true; auto-links: false;">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 directly output(out);</pre> <p></p> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1327497036765" target="_blank">http://www.open-open.com/lib/view/home/1327497036765</a></p>