SlideShare a Scribd company logo
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Who are these guys?
José Miguel Samper
  Thymeleaf active contributor (since the beginning!)
  OSS author: osSeo, porQual, YAV Tags


Daniel Fernández
  Thymeleaf author & project lead
  Also jasypt, op4j, javatuples, javaRuntype, javagalician
AGENDA
1. Introducing Thymeleaf
2. Natural templating
3. Let's write templates!
4. Present + future
Introducing Thymeleaf
1. Introducing Thymeleaf
2. Natural templating
3. Let's write templates!
4. Present + future
The Project
· 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
· 21st-century feature set
· FUN TO USE!
A template engine? What's that? (I)
· Not a Web Framework
· Usually a part of them
  · Many web frameworks have their own
  · Takes care of the view layer
  · Template + Data = Document


      ${user.name} → John Apricot
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Template engines in Spring MVC (II)
· Abstraction:
  · ViewResolver, View
· Default: JSP + JSTL + Spring taglibs
· Other integrations:
  · Apache Velocity
  · FreeMarker
  · Apache Tiles, XSTL, JasperReports, ...
How does it look like?
The (main) features
· Java, DOM-based
· Online (Web) or Offline (email, XML data...)
· Produces XML, XHTML or HTML5
· Expression eval, i18n, URL rewriting...
· Full Spring MVC integration
  · Spring EL, form binding, i18n...
· Configurable and extensible
· Static prototyping abilities
Some features are special (I)
· DOM-based: Especially made for the web
  · Web UIs are represented as DOM @ browsers
  · DOM allows powerful processing of documents
  · Thymeleaf's DOM means processing power
  · Better than sequential text processing
Some features are special (II)
· Configurability & Extensibility
  · Dialects
          •    From "create your own processor
               libraries"...
          •    ... to "create your own template engine"
  · Resolvers ("finders"): templates, messages...
  · Cache strategies
  · Even "Template Modes"
          •    Decide what you want to call "a template"
          •    If it's DOM-able, it's processable.
Some features are special (III)
· Static prototypes
  · Static prototyping is not your enemy anymore
  · UI usually starts with static prototypes
  · Prototype-to-working-UI usually hard path
  · A new approach: NATURAL TEMPLATING!
Natural Templating
1. Introducing Thymeleaf
2. Natural templating
3. Let's write templates!
4. Present + future
Natural what?
· From Wikipedia: Template Engine (web)


“Natural Templates = the template can be
  a document as valid as the final result,
   the engine syntax doesn't break the
          document's structure”
How do we 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
How can that be done?
· Take profit of browsers' display behaviour
· Use custom attribs, browsers ignore them

    <div exec="doit()">...</div>

· No expressions inside tag bodies

   <div exec="substitute_body('hello!')">
      Some nice prototyping text...
   </div>
Can JSP do it?
Can JSP do it?




             NO :-(
Can JSP+JSTL do it?
Can JSP+JSTL do it?




            NO :-|
Can Velocity do it?
Can Velocity do it?




            NO :o(
Can FreeMarker do it?
Can FreeMarker do it?




            NO :-[
And... can Thymeleaf do it?
And... can Thymeleaf do it?




           YES! ;-)
Just how bad is not having this? (I)
thvsjsp (example app): JSP on web server
Just how bad is not having this? (II)
thvsjsp: Thymeleaf on web server
Just how bad is not having this? (III)
thvsjsp: JSP statically displayed
Just how bad is not having this? (IV)
thvsjsp: Thymeleaf statically displayed
Let's write templates!
1. Introducing Thymeleaf
2. Natural templating
3. Let's write templates!
4. Present + future
Writing texts
· th:text HTML-escaped text (default)
· th:utext unescaped text
Formatting
#dates, #calendars, #numbers, #strings...
URLs
· @{...} syntax


 ...produces...



· Automatic URL-rewriting is performed
Iteration
· th:each



 ...produces...
Iteration status
· th:each



...produces...
Conditionals (I)
· th:if



· th:unless
Conditionals (II)
· th:switch / th:case
Forms and bean-binding (I)
· th:object, th:field
Forms and bean-binding (II)
· Forms integrate fully with Spring
  · th:field acts exactly as Spring taglib tags
         •   Slightly different behaviour depending on
             host tag
  · PropertyEditors work OK
  · Spring EL expressions in th:field work OK
  · Validations work OK (th:errors)
Page composition
· Declare fragment with th:fragment




· Reuse th:include



· ...and reuse again...
Inlining
· Text, Javascript and Dart inlining
· th:inline="text"|"javascript"|"dart"
Present + Future
1. Introducing Thymeleaf
2. Natural templating
3. Let's write templates!
4. Present + future
Does anybody use this thing?
· OSS = # of users difficult to know
· Jul 2011 - Jan 2012: 2,528 downloads
  · Strongly increasing rate
  · Top country @SF.net: China (37%)
  · With Spring integrations @maven: 89%
Thymeleaf in production
· sahibinden.com
 · Online classifieds & ecommerce, Turkey
 · [alexa.com] rank 625th worldwide, 9th Turkey
 · Search engine frontend
        •   View layer: Thymeleaf 2.0
        •   Size: 20 servers
        •   1 Billion hits/month ~385/sec
 · Helped in boosting Thymeleaf performance
The Future
· Detached template modes
        –   One file for HTML, another for instructions
· More performance fine-tuning
· More docs, tutorials, example apps...
· Maven archetype(s)
· ...
Where to go, what to see...
· Documentation, articles, code examples
   http://www.thymeleaf.org/documentation.html



· User forum
            http://forum.thymeleaf.org/



· Twitter
                    @thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Ad

More Related Content

What's hot (20)

REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
Joshua Long
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
Areski Belaid
 
OWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling PicklesOWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling Pickles
Christopher Frohoff
 
React Hooks
React HooksReact Hooks
React Hooks
Joao Marins
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
zeeshanhanif
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
Angular 2
Angular 2Angular 2
Angular 2
Nigam Goyal
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring Boot
Omri Spector
 
Spring annotation
Spring annotationSpring annotation
Spring annotation
Rajiv Srivastava
 
JQuery UI
JQuery UIJQuery UI
JQuery UI
Gary Yeh
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
Jennifer Estrada
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Edureka!
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 
Spring Boot
Spring BootSpring Boot
Spring Boot
HongSeong Jeon
 
Flask
FlaskFlask
Flask
Mamta Kumari
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
Bui Kiet
 
Locators in selenium - BNT 09
Locators in selenium - BNT 09Locators in selenium - BNT 09
Locators in selenium - BNT 09
weekendtesting
 
Angular
AngularAngular
Angular
LearningTech
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
Joshua Long
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
Areski Belaid
 
OWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling PicklesOWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling Pickles
Christopher Frohoff
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring Boot
Omri Spector
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Edureka!
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
Bui Kiet
 
Locators in selenium - BNT 09
Locators in selenium - BNT 09Locators in selenium - BNT 09
Locators in selenium - BNT 09
weekendtesting
 

Viewers also liked (20)

Thymeleaf Introduction
Thymeleaf IntroductionThymeleaf Introduction
Thymeleaf Introduction
Anthony Chen
 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
NexThoughts Technologies
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVM
Jeroen Reijn
 
Thymeleaf, will it blend?
Thymeleaf, will it blend?Thymeleaf, will it blend?
Thymeleaf, will it blend?
Jasha Joachimsthal
 
Introducing thymeleaf
Introducing thymeleafIntroducing thymeleaf
Introducing thymeleaf
eiryu
 
Thymeleafでハマったこと
ThymeleafでハマったことThymeleafでハマったこと
Thymeleafでハマったこと
eiryu
 
Thymeleafのすすめ
ThymeleafのすすめThymeleafのすすめ
Thymeleafのすすめ
eiryu
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
Broadleaf Commerce
 
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
ENSET, Université Hassan II Casablanca
 
App Design + Layout
App Design + LayoutApp Design + Layout
App Design + Layout
PuttiApps
 
Website design configuration
Website design configurationWebsite design configuration
Website design configuration
PuttiApps
 
RESTful web services using java and spring
RESTful web services using java and springRESTful web services using java and spring
RESTful web services using java and spring
Muhammad Junaid Ansari
 
Web-Entwicklung mit Spring, Hibernate und Facelets in Eclipse
Web-Entwicklung mit Spring, Hibernate und Facelets in EclipseWeb-Entwicklung mit Spring, Hibernate und Facelets in Eclipse
Web-Entwicklung mit Spring, Hibernate und Facelets in Eclipse
Sarah Steffen
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
rostislav
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvm
NLJUG
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
Naresh Chintalcheru
 
打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪
打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪
打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪
奕孝 陳
 
Spring Security
Spring SecuritySpring Security
Spring Security
Boy Tech
 
Spring User Group Thymeleaf 08-21-2013
Spring User Group Thymeleaf 08-21-2013Spring User Group Thymeleaf 08-21-2013
Spring User Group Thymeleaf 08-21-2013
Justin Munn
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
Tim Donohue
 
Thymeleaf Introduction
Thymeleaf IntroductionThymeleaf Introduction
Thymeleaf Introduction
Anthony Chen
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVM
Jeroen Reijn
 
Introducing thymeleaf
Introducing thymeleafIntroducing thymeleaf
Introducing thymeleaf
eiryu
 
Thymeleafでハマったこと
ThymeleafでハマったことThymeleafでハマったこと
Thymeleafでハマったこと
eiryu
 
Thymeleafのすすめ
ThymeleafのすすめThymeleafのすすめ
Thymeleafのすすめ
eiryu
 
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
ENSET, Université Hassan II Casablanca
 
App Design + Layout
App Design + LayoutApp Design + Layout
App Design + Layout
PuttiApps
 
Website design configuration
Website design configurationWebsite design configuration
Website design configuration
PuttiApps
 
RESTful web services using java and spring
RESTful web services using java and springRESTful web services using java and spring
RESTful web services using java and spring
Muhammad Junaid Ansari
 
Web-Entwicklung mit Spring, Hibernate und Facelets in Eclipse
Web-Entwicklung mit Spring, Hibernate und Facelets in EclipseWeb-Entwicklung mit Spring, Hibernate und Facelets in Eclipse
Web-Entwicklung mit Spring, Hibernate und Facelets in Eclipse
Sarah Steffen
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
rostislav
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvm
NLJUG
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
Naresh Chintalcheru
 
打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪
打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪
打造完全免費的,JAVA專案持續整合環境_ 2013 java developer_day_by 李書豪
奕孝 陳
 
Spring Security
Spring SecuritySpring Security
Spring Security
Boy Tech
 
Spring User Group Thymeleaf 08-21-2013
Spring User Group Thymeleaf 08-21-2013Spring User Group Thymeleaf 08-21-2013
Spring User Group Thymeleaf 08-21-2013
Justin Munn
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
Tim Donohue
 
Ad

Similar to Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf (20)

Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
Marco Breveglieri
 
TypeScript-SPS-melb.pptx
TypeScript-SPS-melb.pptxTypeScript-SPS-melb.pptx
TypeScript-SPS-melb.pptx
accordv12
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
Johan Edstrom
 
Surge2012
Surge2012Surge2012
Surge2012
davidapacheco
 
Intro javascript build a scraper (3:22)
Intro javascript   build a scraper (3:22)Intro javascript   build a scraper (3:22)
Intro javascript build a scraper (3:22)
Thinkful
 
Agile Software Development by Sencha
Agile Software Development by SenchaAgile Software Development by Sencha
Agile Software Development by Sencha
Lael Rukius
 
Dust.js
Dust.jsDust.js
Dust.js
Yevgeniy Brikman
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScript
Axway Appcelerator
 
The JavaScript Delusion
The JavaScript DelusionThe JavaScript Delusion
The JavaScript Delusion
JUGBD
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
team11vgnt
 
Functional solid
Functional solidFunctional solid
Functional solid
Matt Stine
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
Fokke Zandbergen
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and Thymeleaf
LAY Leangsros
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
jskulski
 
The Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from ClojureThe Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from Clojure
Hsuan Fu Lien
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your life
Davide Mauri
 
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
7mind
 
This is presentation at Mitaka.rb #10.
This is presentation at Mitaka.rb #10.This is presentation at Mitaka.rb #10.
This is presentation at Mitaka.rb #10.
Masaki Komagata
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
Vinay H G
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
Marco Breveglieri
 
TypeScript-SPS-melb.pptx
TypeScript-SPS-melb.pptxTypeScript-SPS-melb.pptx
TypeScript-SPS-melb.pptx
accordv12
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
Johan Edstrom
 
Intro javascript build a scraper (3:22)
Intro javascript   build a scraper (3:22)Intro javascript   build a scraper (3:22)
Intro javascript build a scraper (3:22)
Thinkful
 
Agile Software Development by Sencha
Agile Software Development by SenchaAgile Software Development by Sencha
Agile Software Development by Sencha
Lael Rukius
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScript
Axway Appcelerator
 
The JavaScript Delusion
The JavaScript DelusionThe JavaScript Delusion
The JavaScript Delusion
JUGBD
 
Functional solid
Functional solidFunctional solid
Functional solid
Matt Stine
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and Thymeleaf
LAY Leangsros
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
jskulski
 
The Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from ClojureThe Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from Clojure
Hsuan Fu Lien
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your life
Davide Mauri
 
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
7mind
 
This is presentation at Mitaka.rb #10.
This is presentation at Mitaka.rb #10.This is presentation at Mitaka.rb #10.
This is presentation at Mitaka.rb #10.
Masaki Komagata
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
Vinay H G
 
Ad

Recently uploaded (20)

Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 

Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf

  • 2. Who are these guys? José Miguel Samper Thymeleaf active contributor (since the beginning!) OSS author: osSeo, porQual, YAV Tags Daniel Fernández Thymeleaf author & project lead Also jasypt, op4j, javatuples, javaRuntype, javagalician
  • 3. AGENDA 1. Introducing Thymeleaf 2. Natural templating 3. Let's write templates! 4. Present + future
  • 4. Introducing Thymeleaf 1. Introducing Thymeleaf 2. Natural templating 3. Let's write templates! 4. Present + future
  • 5. The Project · 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 · 21st-century feature set · FUN TO USE!
  • 6. A template engine? What's that? (I) · Not a Web Framework · Usually a part of them · Many web frameworks have their own · Takes care of the view layer · Template + Data = Document ${user.name} → John Apricot
  • 8. Template engines in Spring MVC (II) · Abstraction: · ViewResolver, View · Default: JSP + JSTL + Spring taglibs · Other integrations: · Apache Velocity · FreeMarker · Apache Tiles, XSTL, JasperReports, ...
  • 9. How does it look like?
  • 10. The (main) features · Java, DOM-based · Online (Web) or Offline (email, XML data...) · Produces XML, XHTML or HTML5 · Expression eval, i18n, URL rewriting... · Full Spring MVC integration · Spring EL, form binding, i18n... · Configurable and extensible · Static prototyping abilities
  • 11. Some features are special (I) · DOM-based: Especially made for the web · Web UIs are represented as DOM @ browsers · DOM allows powerful processing of documents · Thymeleaf's DOM means processing power · Better than sequential text processing
  • 12. Some features are special (II) · Configurability & Extensibility · Dialects • From "create your own processor libraries"... • ... to "create your own template engine" · Resolvers ("finders"): templates, messages... · Cache strategies · Even "Template Modes" • Decide what you want to call "a template" • If it's DOM-able, it's processable.
  • 13. Some features are special (III) · Static prototypes · Static prototyping is not your enemy anymore · UI usually starts with static prototypes · Prototype-to-working-UI usually hard path · A new approach: NATURAL TEMPLATING!
  • 14. Natural Templating 1. Introducing Thymeleaf 2. Natural templating 3. Let's write templates! 4. Present + future
  • 15. Natural what? · From Wikipedia: Template Engine (web) “Natural Templates = the template can be a document as valid as the final result, the engine syntax doesn't break the document's structure”
  • 16. How do we 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
  • 17. How can that be done? · Take profit of browsers' display behaviour · Use custom attribs, browsers ignore them <div exec="doit()">...</div> · No expressions inside tag bodies <div exec="substitute_body('hello!')"> Some nice prototyping text... </div>
  • 18. Can JSP do it?
  • 19. Can JSP do it? NO :-(
  • 21. Can JSP+JSTL do it? NO :-|
  • 23. Can Velocity do it? NO :o(
  • 25. Can FreeMarker do it? NO :-[
  • 27. And... can Thymeleaf do it? YES! ;-)
  • 28. Just how bad is not having this? (I) thvsjsp (example app): JSP on web server
  • 29. Just how bad is not having this? (II) thvsjsp: Thymeleaf on web server
  • 30. Just how bad is not having this? (III) thvsjsp: JSP statically displayed
  • 31. Just how bad is not having this? (IV) thvsjsp: Thymeleaf statically displayed
  • 32. Let's write templates! 1. Introducing Thymeleaf 2. Natural templating 3. Let's write templates! 4. Present + future
  • 33. Writing texts · th:text HTML-escaped text (default) · th:utext unescaped text
  • 35. URLs · @{...} syntax ...produces... · Automatic URL-rewriting is performed
  • 40. Forms and bean-binding (I) · th:object, th:field
  • 41. Forms and bean-binding (II) · Forms integrate fully with Spring · th:field acts exactly as Spring taglib tags • Slightly different behaviour depending on host tag · PropertyEditors work OK · Spring EL expressions in th:field work OK · Validations work OK (th:errors)
  • 42. Page composition · Declare fragment with th:fragment · Reuse th:include · ...and reuse again...
  • 43. Inlining · Text, Javascript and Dart inlining · th:inline="text"|"javascript"|"dart"
  • 44. Present + Future 1. Introducing Thymeleaf 2. Natural templating 3. Let's write templates! 4. Present + future
  • 45. Does anybody use this thing? · OSS = # of users difficult to know · Jul 2011 - Jan 2012: 2,528 downloads · Strongly increasing rate · Top country @SF.net: China (37%) · With Spring integrations @maven: 89%
  • 46. Thymeleaf in production · sahibinden.com · Online classifieds & ecommerce, Turkey · [alexa.com] rank 625th worldwide, 9th Turkey · Search engine frontend • View layer: Thymeleaf 2.0 • Size: 20 servers • 1 Billion hits/month ~385/sec · Helped in boosting Thymeleaf performance
  • 47. The Future · Detached template modes – One file for HTML, another for instructions · More performance fine-tuning · More docs, tutorials, example apps... · Maven archetype(s) · ...
  • 48. Where to go, what to see... · Documentation, articles, code examples http://www.thymeleaf.org/documentation.html · User forum http://forum.thymeleaf.org/ · Twitter @thymeleaf