Thymeleaf http www thymeleaf org Introducing Thymeleaf Its
- Slides: 20
Thymeleaf http: //www. thymeleaf. org/
Introducing Thymeleaf • • It's a Java Template Engine Can be used as view layer in Spring MVC First stable release: July 2011 Currently: 2. 0. x Elegant, configurable, extensible 21 st-century feature set FUN TO USE!
How does it look like?
Standard and Spring. Standard Dialects • • • XML, XHTML 1. 0, XHTML 1. 1 and HTML 5 support. Complete substitute for view-layer web technologies such as JSP. Easy-to-use, elegant syntax based on attributes only (these dialects include no tags). • • Natural templating for easy prototyping: display your templates statically in a browser (without running your app server). Expression evaluation: OGNL (Standard) and Spring Expression Language (Spring. Standard). Complete integration with Spring MVC (Spring. Standard): form binding, property editors, internationalization, etc. Spring Web. Flow support (including AJAX events). Fully-featured template logic: iteration, conditional evaluation, context variable declaration, etc. Several options for layout (Composite View pattern): • • Great for web templates: <input type="text" th: field="*{name}" /> instead of <mylib: text field="name" /> A builtin mechanism (Thymeleaf's native fragment inclusion). Specific Apache Tiles integration (through extras package). Can be used along with Site. Mesh. Internationalization support: easy inclusion of externalized messages into templates. URL rewriting capabilities for adding context and session information to URLs. Java. Script and Dart inlining: intelligent evaluation of expressions inside javascript/dart code. Template validation support for XML, XHTML 1. 0 and XHTML 1. 1.
Can Jsp do it?
Can JSP+JSTL Do it?
Can Velocity do it?
Can Free. Marker Do it?
. . . Can Thymeleaf do it?
How dowe evaluate it? • “valid document, don't break structure” • Templates should be statically displayable • Static = Open in browser, no web server • Templates should work as prototypes
Now Let’s write templates!
Texts • th: text HTML-escaped text (default) • th: utext unescaped text
Formatting • #dates, #calendars, #numbers, #strings. . .
URLs • @{. . . } syntax • Automatic URL-rewriting is performed
Iteration • th: each
Iteration status • th: each
Conditionals • th: if • th: unless • th: swithc/th: case
Forms and beanbinding • th: object, th: field
Page compostion • Declare fragment with th: fragment • Resuse th: include
Who is using Thymeleaf?
- Thymeleaf layout
- Thymeleaf for문
- Http //mbs.meb.gov.tr/ http //www.alantercihleri.com
- Siat ung sistem informasi akademik
- Http://www.blueplanetbiomes.org/world_biomes.htm
- Http://oh.portal.airast.org
- Etscriterion
- Http://www.caaspp.org
- Http://hdr.undp.org/en/data
- Http://www.pbs.org/ktca/liberty/
- Http://mbgnet.mobot.org/
- Http://www.caaspp.org
- Http //pisa.ets.org/school questionnaire
- Www.python.org
- Http://www.finaid.org/calculators/loanpayments.phtml
- Education planner learning style quiz
- Www.python.or
- Number of neutrons in xenon
- Http://hdr.undp.org/en/countries
- Http://fsassessments.org
- Http://library.thinkquest.org