SlideShare a Scribd company logo
2018
Spring forward: an introduction to Spring
boot and Thymeleaf for (XPages) developers
Frank van der Linden
Full stack Developer
elstar IT
Thanks to our 2018 Sponsors
INFORMATION SOLUTIONS
REDTABLE
Me
• Freelance Full stack developer
• Owner of elstar IT
• Curious of new technology
• IBM Champion 2013, 2014, 2017 and 2018
3
Disclaimer
4
Session is NOT about Domino and XPages
How to proceed
• What is Spring boot and Thymeleaf
• Similarities and differences
• Runs everywhere
• How to start
• Syntax
• Security
• New possibilities
5
What is Spring boot and
Thymeleaf
Spring Ecosystem
7
Spring boot
• Open source, Pivotal is coordinating.
• Spring boot creates Spring (Java) based applications
• Embedded Tomcat makes it ‘just’ run everywhere
• Auto configure as much as possible
• Built in metrics and health checks
• Easy to configure with YAML or property file
• Very good documentation and code examples
• Fast creation of REST api’s
8
Thymeleaf
• Is a template engine
• Based on Java and HTML5
• Very strict, or template will break
• Full Spring framework support
• Extensible with dialects
• Full (and extensible) internationalisation support.
• Reusable fragments, like of Custom Controls
• Extensive documentation
9
Similarities and differences
11
XPages Spring Boot/Thymeleaf
Configure Faces-config @Autowired
Endpoints Need work or SmartNSF very strong support
Security Built-in Need Spring Security
Add-ons
Lots of 3rd party add-on
Thanks to OpenNTF
Lots of 3rd party add-on
Deployment Runs on Domino Runs everwhere
Build Pain of the Domino Designer Maven/Gradle build out-of-the box
IDE
DDE (Windows)
for OSGi plugins almost every IDE
Almost every IDE, like Netbeans, Eclipse, IntelliJ and more
(Windows, Linux, MacOS)
Runs everywhere
Runs everywhere
• With Embedded Tomcat as default the jar ‘just run’
• More choices of embedded web server, in the future also OpenLiberty
• Will run on Docker
• Will run on Cloud Foundry, like IBM Cloud or Pivotal on Azure
• Tomcat can by excluding to run it on Websphere Application Server,
Tomcat or WildFly (a.k.a JBoss)
• Even on Domino as OSGi plugin, http://hasselba.ch/blog/?p=2589
13
How to start
How to start
• Install Gradle or Maven
• Move over to start.spring.io
• Or use the Starter in IntelliJ
• Fill all the fields and select the required projects (full version)
• Generate project
• Download zip, unzip and add to Git repository.
• Open project in favourite IDE, run ‘mvn clean install’
• Start coding
15
Wizard in IntelliJ
Spring boot setup
17
minimal YAML file
Thymeleaf setup
18
add to pom.xml
How it works together
19
Syntax
Spring boot syntax
21
endpoint to return an object as JSON
endpoint to return a thymeleaf template
Component scan
• Component scan will scan all the packages for @Service,
@Controller, @Repository and more @Component(s)
• @Autowired will glue everything together
22
Thymeleaf syntax
• Include the th namespace to the page
• Every html element attribute has a th:…. Equivalent.
• Variable Expressions: ${...}
• Selection Variable Expressions: *{...}
• Message Expressions: #{...}
• Link URL Expressions: @{...}
23
Namespace
24
<html lang="en" xmlns:th="http://www.thymeleaf.org">
Thymeleaf attributes
25
Variable Expressions
26
Selection Variable Expressions
27
Message Expressions
28
Link URL Expressions
29
resource links
links in on a page
Global objects
30
Fragments (1)
31
Fragments (2)
32
fragment code
use it multiple times
Attachments
• Forget the UploadedFile provided by IBM, learn MultipartFile
• MultipartFile has lots of similarities with UploadedFile, but easier to
use. Less code to achieve the same
33
Security
Spring Security
• Framework for Authentication and Authorisation
• Prevention of clickjacking, CORS, cross site request forgery
• Integrates with Spring Boot and Thymeleaf
• Customisable to the bone
• Support for Basic Authentication, SAML2, oAuth and more.
35
Configuration
36
CORS prevention
Spring security in Thymeleaf
37
add to pom.xml
add namespace
New possibilities
Lombok
• Forget Getters and Setters
• Forget toString, hashCode and equals
• One @Annotations rules the all (@Data or @Getter and @Setter)
• Add logging by @annotations (@Log4j2 or @Slf4j)
39
Lombok
40
add to pom.xml
add @Data
using the build in logging
Swagger
• Part of Open API Specification, since v3
• Documentation of API’s
• Playground for testing
• Add annotation to generate the documentation dynamically
41
Swagger
42
add to pom.xml
add a configuration
add annotation to endpoint
Jenkins
• With Jenkins you can build automatically the application
• …But also do quality control, do load tests and even deploy.
• JenkinsFile should be in the root of the GIT Repository
• Groovy is the language for JenkinsFile
43
Jenkins file
44
Spring Forward Starter
45
https://bitbucket.org/flinden68/spring-forward-starter
Questions
Reach out to me
• @flinden68
• http://www.elstarit.nl
• flinden68@elstarit.nl
• https://nl.linkedin.com/in/flinden68
47
Resources
• Spring Initializr
• http://start.spring.io/
• Thymeleaf documentation
• http://www.thymeleaf.org/
• Spring Boot
• https://projects.spring.io/spring-boot/
• Lombok
• https://projectlombok.org/
• Jenkins
• https://jenkins.io/
48
Resources
• Swagger
• http://swagger.io
• Thymeleaf documentation
• http://www.thymeleaf.org/
• Maven
• https://maven.apache.org/
• Gradle
• https://gradle.org/
• Spring Forward Starter
• https://bitbucket.org/flinden68/spring-forward-starter
49
Thanks to our 2018 Sponsors
INFORMATION SOLUTIONS
REDTABLE

More Related Content

PDF
Spring forward: an introduction to Spring boot and Thymeleaf
PDF
Engage 2020: Hello are you listening, There is stream for everything
PDF
NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...
PDF
NCUG 2019: Super charge your API’s with Reactive streams
PPTX
Standard libraries with_xamarin
PPT
OWASP WebGoat and PANTERA Web Assessment Studio Project.
ODP
OWASP WTE - Now in the Cloud!
PPTX
Laravel Webcon 2015
Spring forward: an introduction to Spring boot and Thymeleaf
Engage 2020: Hello are you listening, There is stream for everything
NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...
NCUG 2019: Super charge your API’s with Reactive streams
Standard libraries with_xamarin
OWASP WebGoat and PANTERA Web Assessment Studio Project.
OWASP WTE - Now in the Cloud!
Laravel Webcon 2015

What's hot (20)

PPT
Uklug2012 yellow and blue stream
PPTX
Microsoft ASP.NET 5 - The new kid on the block
PDF
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
PDF
10 Things you should know about Ruby
PDF
YAPC::EU 2015 - Perl Conferences
PPTX
Saving Time By Testing With Jest
PPTX
Automating JavaScript testing with Jasmine and Perl
PDF
Vladimir Ulogov - Beyond the Loadable Module
PPTX
Introduction to Dependency Injection
PDF
Spring Boot
ODP
OWASP 2015 AppSec EU ZAP 2.4.0 and beyond..
PDF
Developing Resilient Cloud Native Apps with Spring Cloud
ODP
2014 ZAP Workshop 2: Contexts and Fuzzing
PPTX
The tale of 100 cve's
PPTX
Mini-Training: Let's have a rest
PPTX
A brief intro to nodejs
PDF
Tabtale story: Building a publishing and monitoring mobile games architecture...
PDF
Legacy Sins
ODP
JavaOne 2014 Security Testing for Developers using OWASP ZAP
PDF
ELK Stack
Uklug2012 yellow and blue stream
Microsoft ASP.NET 5 - The new kid on the block
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
10 Things you should know about Ruby
YAPC::EU 2015 - Perl Conferences
Saving Time By Testing With Jest
Automating JavaScript testing with Jasmine and Perl
Vladimir Ulogov - Beyond the Loadable Module
Introduction to Dependency Injection
Spring Boot
OWASP 2015 AppSec EU ZAP 2.4.0 and beyond..
Developing Resilient Cloud Native Apps with Spring Cloud
2014 ZAP Workshop 2: Contexts and Fuzzing
The tale of 100 cve's
Mini-Training: Let's have a rest
A brief intro to nodejs
Tabtale story: Building a publishing and monitoring mobile games architecture...
Legacy Sins
JavaOne 2014 Security Testing for Developers using OWASP ZAP
ELK Stack
Ad

Similar to Icon UK 2018 - Spring forward: an introduction to Spring boot and Thymeleaf for (XPages) developers (20)

PDF
Securing applications
PDF
Stackato v6
PDF
Stackato
PDF
CrossWorlds: Unleash the Power of Domino for Connections Development
PDF
Securing Legacy CFML Code
PPTX
PowerShell for the Anxious ITPro
PDF
Social Connections 2015 CrossWorlds and Domino
PDF
Beyond Domino Designer
PDF
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
PDF
XPages Blast - Lotusphere 2011
PPTX
Hot to build continuously processing for 24/7 real-time data streaming platform?
PPTX
Integrating Splunk into your Spring Applications
PDF
Understand the Trade-offs Using Compilers for Java Applications
PDF
Oracle WebLogic Diagnostics & Perfomance tuning
PPTX
GCP Deployment- Vertex AI
PDF
Presentation about Overthere for J-Fall 2011
PDF
Introduction to Micronaut - JBCNConf 2019
PPTX
DCRUG: Achieving Development-Production Parity
PPTX
Utilizing the OpenNTF Domino API
PDF
Stackato v4
Securing applications
Stackato v6
Stackato
CrossWorlds: Unleash the Power of Domino for Connections Development
Securing Legacy CFML Code
PowerShell for the Anxious ITPro
Social Connections 2015 CrossWorlds and Domino
Beyond Domino Designer
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
XPages Blast - Lotusphere 2011
Hot to build continuously processing for 24/7 real-time data streaming platform?
Integrating Splunk into your Spring Applications
Understand the Trade-offs Using Compilers for Java Applications
Oracle WebLogic Diagnostics & Perfomance tuning
GCP Deployment- Vertex AI
Presentation about Overthere for J-Fall 2011
Introduction to Micronaut - JBCNConf 2019
DCRUG: Achieving Development-Production Parity
Utilizing the OpenNTF Domino API
Stackato v4
Ad

More from Frank van der Linden (20)

PPTX
Engage Usergroup 2024 - The Good The Bad_The Ugly
PDF
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
PDF
Social connections14: Super charge your API’s with Reactive streams
PDF
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
PDF
Wcs-1785 How Watson, Bluemix, Cloudant and XPages can work together in a real...
PPTX
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
PPTX
A (XPages) developers guide to Cloudant - MeetIT
PPTX
A (XPages) developers guide to Cloudant
PPTX
Let's serve your data
PPTX
Let's server your Data
PPTX
Don't worry with bower
PPTX
Bccon use notes objects in memory and other useful
PPTX
Use notes objects in memory and other useful java tips for xpages development
PPTX
An XPager's Guide to Process Server-Side Jobs on Domino
PPTX
The power of dots
PPTX
Let me introduce you: DOTS
PPTX
Integrate domino designer with cvs source control
PPTX
how to connect your app to the activity stream with x-pages
ODP
Domino point2012 integrate domino designer with cvs source control
PPTX
Dnug2012 yellow and blue stream
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Social connections14: Super charge your API’s with Reactive streams
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
Wcs-1785 How Watson, Bluemix, Cloudant and XPages can work together in a real...
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
A (XPages) developers guide to Cloudant - MeetIT
A (XPages) developers guide to Cloudant
Let's serve your data
Let's server your Data
Don't worry with bower
Bccon use notes objects in memory and other useful
Use notes objects in memory and other useful java tips for xpages development
An XPager's Guide to Process Server-Side Jobs on Domino
The power of dots
Let me introduce you: DOTS
Integrate domino designer with cvs source control
how to connect your app to the activity stream with x-pages
Domino point2012 integrate domino designer with cvs source control
Dnug2012 yellow and blue stream

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PPTX
history of c programming in notes for students .pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Introduction to Artificial Intelligence
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPT
Introduction Database Management System for Course Database
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
ai tools demonstartion for schools and inter college
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
medical staffing services at VALiNTRY
history of c programming in notes for students .pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Design an Analysis of Algorithms II-SECS-1021-03
How to Choose the Right IT Partner for Your Business in Malaysia
L1 - Introduction to python Backend.pptx
Introduction to Artificial Intelligence
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Introduction Database Management System for Course Database
Upgrade and Innovation Strategies for SAP ERP Customers
Odoo POS Development Services by CandidRoot Solutions
VVF-Customer-Presentation2025-Ver1.9.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
ai tools demonstartion for schools and inter college
How Creative Agencies Leverage Project Management Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Which alternative to Crystal Reports is best for small or large businesses.pdf

Icon UK 2018 - Spring forward: an introduction to Spring boot and Thymeleaf for (XPages) developers