Thymleaf Tech Talk 2013 05-09


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Thymleaf Tech Talk 2013 05-09

  1. 1. Credera is a full-service management andtechnology consulting firm. Our clients rangefrom Fortune 1,000 companies to emergingindustry leaders. We provide expert, objectiveadvice to help solve complex business andtechnology challenges.Dallas Office15303 Dallas ParkwaySuite 300Addison, TX 75001972.692.0010 Phone972.692.0019 FaxDenver Office5445 DTC ParkwaySuite 1040Greenwood Village, CO 80111303.623.1344 Phone303.484.4577 FaxHouston Office800 Town & Country BlvdSuite 300Houston, TX 77024713.496.0711 Phone713.401.9650 FaxAustin Office9020 N Capital of Texas HwySuite 345Austin, TX 78759512.327.1112 Phone512.233.0844 Fax
  2. 2. Discussion document – Strictly Confidential & ProprietaryThymeleaf:Better than JSPDallas, TXMay 09, 2013
  3. 3. May 09, 2013Thymeleaf: Better than JSP3Agenda …We will have a brief overview of Thymeleaf followed by a demonstrationAgenda• What is Thymeleaf• Comparison with JSP• Demo• References
  4. 4. What is ThymeleafMay 09, 2013Thymeleaf: Better than JSP4
  5. 5. May 09, 2013Thymeleaf: Better than JSP5What is Thymeleaf…Thymeleaf is a Java based XML/ XHTML/ HTML5 template engineCore Features• Supports several template modes– XML, XHTML, HTML5– Extendable to any template type that can be modeled using DOM• Standard I18N support through properties files• Modular feature sets supported as Dialects• Attribute based processing• Built in View CachingPrimary Integrations• Standard Spring MVC Integration– Support for Spring form binding and property editors– Supports Internationalization through Spring MessageSource• Apache Tiles• Spring Security 3.x• Eclipse IDE Autocomplete
  6. 6. May 09, 2013Thymeleaf: Better than JSP6What is Thymeleaf…Thymeleaf uses attribute based processing to allow for natural templatingWhat does it look like?<table><thead><tr><th th:text="#{}">Name</th><th th:text="#{msgs.headers.price}">Price</th></tr></thead><tbody><tr th:each="prod : ${allProducts}"><td th:text="${}">Oranges</td><td th:text="${#numbers.formatDecimal(prod.price,1,2)}">0.99</td></tr></tbody></table>
  7. 7. Comparison with JSPMay 09, 2013Thymeleaf: Better than JSP7
  8. 8. May 09, 2013Thymeleaf: Better than JSP8Comparison with JSPThymeleaf is an easy to use template engine that serves as a drop inreplacement for JSPThymeleaf• Attribute based processing– Unobtrusive processing which allowstemplates to be use as static templates• Requires document to be valid XML– Promotes well formed HTML and bettercross-browser compatibility• Extensible through Dialects• Built in support for I18N• Standard module for Spring support• Escapes dynamic text by defaultJSP(X)• Tag based processing– Processing is obtrusive and prevents useas static templates• Allows templates to be written in non-valid XML– Allows not well formed HTML which canhave compatibility issues (JSP only)• Extensible through Taglibs• Supports I18N through fmt Taglib• Supports Spring MVC through taglibs• Escapes dynamic text through c:out tag
  9. 9. DemoMay 09, 2013Thymeleaf: Better than JSP9
  10. 10. May 09, 2013Thymeleaf: Better than JSP10Resources…Thymeleaf has great documentation source which makes it easy to learn• Demo application -• Thymeleaf Resources –– Website –– Documentation -– Repositories Thymeleaf - Spring 3 Module -