HTML5模板引擎 Thymeleaf

fmms 13年前
     <p><a href="http://www.open-open.com/open316821.htm" target="_blank">Thymeleaf</a>是一个XML/XHTML/HTML5模板引擎,可用于Web与非Web环境中的应用开发。它是一个开源的Java库,基于 Apache License 2.0许可,由Daniel Fernández创建,该作者还是Java加密库Jasypt的作者。</p>    <p>Thymeleaf提供了一个用于整合Spring MVC的可选模块,在应用开发中,你可以使用Thymeleaf来完全代替JSP,或其他模板引擎,如Velocity、FreeMarker等。 Thymeleaf的主要目标在于提供一种可被浏览器正确显示的、格式良好的模板创建方式,因此也可以用作静态建模。你可以使用它创建经过验证的XML与 HTML模板。相对于编写逻辑或代码,开发者只需将标签属性添加到模板中即可。接下来,这些标签属性就会在DOM(文档对象模型)上执行预先制定好的逻辑。</p>    <p>示例模板:</p>    <pre class="brush:html; toolbar: true; auto-links: false;"><table>    <thead>      <tr>        <th th:text="#{msgs.headers.name}">Name</td>        <th th:text="#{msgs.headers.price}">Price</td>      </tr>    </thead>    <tbody>      <tr th:each="prod : ${allProducts}">        <td th:text="${prod.name}">Oranges</td>        <td th:text="${#numbers.formatDecimal(prod.price,1,2)}">0.99</td>      </tr>    </tbody>  </table></pre>    <p></p>    <p>Thymeleaf 1.1.1 发布了,Thymeleaf 是一个 <strong>XML/XHTML/HTML5</strong> 模板引擎,提供一组模板文件到文本的转换。</p>    <p>项目地址:<a href="/misc/goto?guid=4958190967297852637" target="_blank">http://www.thymeleaf.org/</a><br /> 下载地址:<a title="Click to download thymeleaf-1.1.1-dist.zip" href="/misc/goto?guid=4958190968034721944">thymeleaf-1.1.1-dist.zip</a></p>    <p></p>