SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Will it blend?
Jasha Joachimsthal
@jashaj
1
Thymeleaf, will it blend? 18-04-2013
Background
• 1995: My <blink>first</blink> html page
• 1998: CSS & Java
• 1999: PHP
• 2003:ASP
• 2006: XSLT
• 2009: JSP
• 2010: Spring MVC & Freemarker
• 2012: Ruby,Thymeleaf
http://www.phdcomics.com/comics/archive/phd012113s.gif
2
Thymeleaf, will it blend? 18-04-2013
Thymeleaf
• Java library
• XML/XHTML/HTML5 template engine
• support for static and dynamic content
• http://www.thymeleaf.org
3
Thymeleaf, will it blend? 18-04-2013
Project timeline
• Wireframes
• Design in Photoshop
• Clickable with static HTML
• Converted into dynamic pages with JSP,
ASP, PHP...
4
Thymeleaf, will it blend? 18-04-2013
Copied from design
• CSS
• Javascripts
• static images
5
Thymeleaf, will it blend? 18-04-2013
The big challenge
• HTML is divided over several templates
• Logic is added to show/hide elements
• Links are different
• Labels are translated
• CSS/Javascript may be minified during build
6
Thymeleaf, will it blend? 18-04-2013
Preview JSP in browser?
7
Thymeleaf, will it blend? 18-04-2013
Preview Thymeleaf!
8
Thymeleaf, will it blend? 18-04-2013
Preview Thymeleaf!
9
Thymeleaf, will it blend? 18-04-2013
JSP tagsoup
<c:if test="${foo}">
<c:set var="cssClass"
value=" class=‘myclass’"/>
</c:if>
<div${cssClass}>
<p>some other stuff...</p>
</div>
10
Thymeleaf, will it blend? 18-04-2013
Thymeleaf template
<div th:class=”${foo} ? ‘myclass’”>
<p>some other stuff...</p>
</div>
11
Thymeleaf, will it blend? 18-04-2013
Paths and labels change
<c:url=”/corporate/news?page=$
{nextPage}” var=”link”/>
<fmt:message=”more.news”
var=”linkText”/>
<a href=”${link}”>${linkText}</a>
12
Thymeleaf, will it blend? 18-04-2013
Paths and labels
<a href=”news-list.html
th:href=”@{/corporate/news(page=
${nextPage})}”
th:text=”#{more.news}”>
More news</a>
13
Thymeleaf, will it blend? 18-04-2013
Thymol
• Javascript for the static templates
• Resolves fragments
• Parses simple if statements
• http://sourceforge.net/u/jjbenson/wiki/
thymol/
14
Thymeleaf, will it blend? 18-04-2013
Fragments
• Frequently used parts like header, footer
• Define fragment once
• Call fragment from every page
• Can be rendered by Thymeleaf (server side)
and Thymol (client side)
15
Thymeleaf, will it blend? 18-04-2013
Fragment: footer
<footer th:fragment=”footer”>
<ul>
<li>&copy; 2013 My Company</li>
<li><a href=”text.html”
th:href=”@{/privacy}”>Privacy</a>
</ul>
</footer>
<footer th:include=”fragments ::
footer”/>
16
Thymeleaf, will it blend? 18-04-2013
Caveats of Thymol
• Cannot handle complex if statements
• Is the DOM ready?
• Do all the elements have a layout?
• Links must have a text
17
Thymeleaf, will it blend? 18-04-2013
Break the preview
• Hide elements behind complex if
statements without alternative
• Forget to add static labels, links, classes etc.
• Create new file without including Thymol
18
Thymeleaf, will it blend? 18-04-2013
Break the server side
• Create valid HTML that is not valid XML
<input name=”foo” required>
• Forget to update the HTML inside the
complex if statement
• Forget to update dynamic paths to CSS,
Javascripts and images
19
Thymeleaf, will it blend? 18-04-2013
Will it blend?
• It depends on the...
• team
• complexity of the application
• need of having an up to date preview
after initial design
20

Más contenido relacionado

La actualidad más candente

Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
olegshpynov
 

La actualidad más candente (20)

Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
Ch5 beeing an application
Ch5   beeing an applicationCh5   beeing an application
Ch5 beeing an application
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Web development basics (Part-7)
Web development basics (Part-7)Web development basics (Part-7)
Web development basics (Part-7)
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
Jekyll, static websites generator
Jekyll, static websites generatorJekyll, static websites generator
Jekyll, static websites generator
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
 
Introduction to blogging with Jekyll
Introduction to blogging with JekyllIntroduction to blogging with Jekyll
Introduction to blogging with Jekyll
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
Jekyll Presentation Slides
Jekyll Presentation SlidesJekyll Presentation Slides
Jekyll Presentation Slides
 
Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHP
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
 

Destacado

Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
Jakub Kubrynski
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
Brett Meyer
 

Destacado (20)

Introducing thymeleaf
Introducing thymeleafIntroducing thymeleaf
Introducing thymeleaf
 
Thymeleaf Introduction
Thymeleaf IntroductionThymeleaf Introduction
Thymeleaf Introduction
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
Thymeleafのすすめ
ThymeleafのすすめThymeleafのすすめ
Thymeleafのすすめ
 
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
 
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
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Introduction to JPA Framework
Introduction to JPA FrameworkIntroduction to JPA Framework
Introduction to JPA Framework
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
 
REST with Spring Boot #jqfk
REST with Spring Boot #jqfkREST with Spring Boot #jqfk
REST with Spring Boot #jqfk
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
 
Overview of JPA (Java Persistence API) v2.0
Overview of JPA (Java Persistence API) v2.0Overview of JPA (Java Persistence API) v2.0
Overview of JPA (Java Persistence API) v2.0
 
JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
 

Similar a Thymeleaf, will it blend?

Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript DevelopereilleSpirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
Tieturi Oy
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibility
jsmith92
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
Joseph Lewis
 
Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011
Ted Husted
 

Similar a Thymeleaf, will it blend? (20)

Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript DevelopereilleSpirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibility
 
Headless Magento - Meet Magento Poland 2017
Headless Magento - Meet Magento Poland 2017Headless Magento - Meet Magento Poland 2017
Headless Magento - Meet Magento Poland 2017
 
Chapter 2 introduction to html5
Chapter 2 introduction to html5Chapter 2 introduction to html5
Chapter 2 introduction to html5
 
Paving the way with Jakarta EE and Apache TomEE - itkonekt 2020
Paving the way with Jakarta EE and Apache TomEE - itkonekt 2020Paving the way with Jakarta EE and Apache TomEE - itkonekt 2020
Paving the way with Jakarta EE and Apache TomEE - itkonekt 2020
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
 
Html5
Html5Html5
Html5
 
Html vs xhtml
Html vs xhtmlHtml vs xhtml
Html vs xhtml
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
 
Polymer & PWA: Understanding the “why”
Polymer & PWA: Understanding the “why”Polymer & PWA: Understanding the “why”
Polymer & PWA: Understanding the “why”
 
Performance tuning of Websites
Performance tuning of WebsitesPerformance tuning of Websites
Performance tuning of Websites
 
Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011
 
West Yorkshire Meetup #3
West Yorkshire Meetup #3West Yorkshire Meetup #3
West Yorkshire Meetup #3
 
HTML 5
HTML 5HTML 5
HTML 5
 
HTML5: The Next Internet Goldrush
HTML5: The Next Internet GoldrushHTML5: The Next Internet Goldrush
HTML5: The Next Internet Goldrush
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracket
 
Web Components
Web ComponentsWeb Components
Web Components
 
Paving the way with Jakarta EE and apache TomEE at cloudconferenceday
Paving the way with Jakarta EE and apache TomEE at cloudconferencedayPaving the way with Jakarta EE and apache TomEE at cloudconferenceday
Paving the way with Jakarta EE and apache TomEE at cloudconferenceday
 
Pavimentando el Camino con Jakarta EE 9 y Apache TomEE 9.0.0
Pavimentando el Camino con Jakarta EE 9 y Apache TomEE 9.0.0Pavimentando el Camino con Jakarta EE 9 y Apache TomEE 9.0.0
Pavimentando el Camino con Jakarta EE 9 y Apache TomEE 9.0.0
 
Html5
Html5 Html5
Html5
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Thymeleaf, will it blend?

  • 1. Will it blend? Jasha Joachimsthal @jashaj 1
  • 2. Thymeleaf, will it blend? 18-04-2013 Background • 1995: My <blink>first</blink> html page • 1998: CSS & Java • 1999: PHP • 2003:ASP • 2006: XSLT • 2009: JSP • 2010: Spring MVC & Freemarker • 2012: Ruby,Thymeleaf http://www.phdcomics.com/comics/archive/phd012113s.gif 2
  • 3. Thymeleaf, will it blend? 18-04-2013 Thymeleaf • Java library • XML/XHTML/HTML5 template engine • support for static and dynamic content • http://www.thymeleaf.org 3
  • 4. Thymeleaf, will it blend? 18-04-2013 Project timeline • Wireframes • Design in Photoshop • Clickable with static HTML • Converted into dynamic pages with JSP, ASP, PHP... 4
  • 5. Thymeleaf, will it blend? 18-04-2013 Copied from design • CSS • Javascripts • static images 5
  • 6. Thymeleaf, will it blend? 18-04-2013 The big challenge • HTML is divided over several templates • Logic is added to show/hide elements • Links are different • Labels are translated • CSS/Javascript may be minified during build 6
  • 7. Thymeleaf, will it blend? 18-04-2013 Preview JSP in browser? 7
  • 8. Thymeleaf, will it blend? 18-04-2013 Preview Thymeleaf! 8
  • 9. Thymeleaf, will it blend? 18-04-2013 Preview Thymeleaf! 9
  • 10. Thymeleaf, will it blend? 18-04-2013 JSP tagsoup <c:if test="${foo}"> <c:set var="cssClass" value=" class=‘myclass’"/> </c:if> <div${cssClass}> <p>some other stuff...</p> </div> 10
  • 11. Thymeleaf, will it blend? 18-04-2013 Thymeleaf template <div th:class=”${foo} ? ‘myclass’”> <p>some other stuff...</p> </div> 11
  • 12. Thymeleaf, will it blend? 18-04-2013 Paths and labels change <c:url=”/corporate/news?page=$ {nextPage}” var=”link”/> <fmt:message=”more.news” var=”linkText”/> <a href=”${link}”>${linkText}</a> 12
  • 13. Thymeleaf, will it blend? 18-04-2013 Paths and labels <a href=”news-list.html th:href=”@{/corporate/news(page= ${nextPage})}” th:text=”#{more.news}”> More news</a> 13
  • 14. Thymeleaf, will it blend? 18-04-2013 Thymol • Javascript for the static templates • Resolves fragments • Parses simple if statements • http://sourceforge.net/u/jjbenson/wiki/ thymol/ 14
  • 15. Thymeleaf, will it blend? 18-04-2013 Fragments • Frequently used parts like header, footer • Define fragment once • Call fragment from every page • Can be rendered by Thymeleaf (server side) and Thymol (client side) 15
  • 16. Thymeleaf, will it blend? 18-04-2013 Fragment: footer <footer th:fragment=”footer”> <ul> <li>&copy; 2013 My Company</li> <li><a href=”text.html” th:href=”@{/privacy}”>Privacy</a> </ul> </footer> <footer th:include=”fragments :: footer”/> 16
  • 17. Thymeleaf, will it blend? 18-04-2013 Caveats of Thymol • Cannot handle complex if statements • Is the DOM ready? • Do all the elements have a layout? • Links must have a text 17
  • 18. Thymeleaf, will it blend? 18-04-2013 Break the preview • Hide elements behind complex if statements without alternative • Forget to add static labels, links, classes etc. • Create new file without including Thymol 18
  • 19. Thymeleaf, will it blend? 18-04-2013 Break the server side • Create valid HTML that is not valid XML <input name=”foo” required> • Forget to update the HTML inside the complex if statement • Forget to update dynamic paths to CSS, Javascripts and images 19
  • 20. Thymeleaf, will it blend? 18-04-2013 Will it blend? • It depends on the... • team • complexity of the application • need of having an up to date preview after initial design 20