HTML5模板引擎 Thymeleaf

openkk 12年前
     <p>Thymeleaf是一个XML/XHTML/HTML5模板引擎,可用于Web与非Web环境中的应用开发。它是一个开源的Java库,基于 Apache License 2.0许可,由Daniel Fernández创建,该作者还是Java加密库Jasypt的作者。</p>    <div id="header">     <a title="Thymeleaf home" href="/misc/goto?guid=4959498293699816831"><img class="logo" alt="HTML5模板引擎 Thymeleaf" src="https://simg.open-open.com/show/1c0e795951cbaad42fea57edff742d11.png" width="384" height="70" /></a>    </div>    <p></p>    <p>Thymeleaf提供了一个用于整合Spring MVC的可选模块,在应用开发中,你可以使用Thymeleaf来完全代替JSP,或其他模板引擎,如Velocity、FreeMarker等。 Thymeleaf的主要目标在于提供一种可被浏览器正确显示的、格式良好的模板创建方式,因此也可以用作静态建模。你可以使用它创建经过验证的XML与 HTML模板。相对于编写逻辑或代码,开发者只需将标签属性添加到模板中即可。接下来,这些标签属性就会在DOM(文档对象模型)上执行预先制定好的逻 辑。</p>    <p>示例模板:<br /> </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><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1322984127827" target="_blank">http://www.open-open.com/lib/view/home/1322984127827</a></p>    <p></p>    <p></p>