SlideShare una empresa de Scribd logo
1 de 48
Descargar para leer sin conexión
Spring forward: an introduction to Spring
boot and Thymeleaf for (XPages)
developers
Frank van der Linden
Full stack Developer
elstar IT
About me
• Freelance Full stack developer
• Owner of elstar IT
• Curious of new technology
• IBM Champion 2013, 2014, 2017, 2018 and 2019
Disclaimer
Session is NOT about #dominoforever
How to proceed
• What is Spring boot and Thymeleaf
• Similarities and differences
• Runs everywhere
• How to start
• Syntax
• Security
• New possibilities
What is Spring boot and
Thymeleaf
Spring Ecosystem
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
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 Custom Controls
• Extensive documentation
Similarities and differences
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
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
Wizard in IntelliJ
Spring boot setup
minimal YAML file
Thymeleaf setup
add to pom.xml
How it works together
Syntax
Spring boot syntax
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
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: @{...}
Namespace
<html lang="en" xmlns:th="http://www.thymeleaf.org">
Thymeleaf attributes
Variable Expressions
Selection Variable Expressions
Message Expressions
Link URL Expressions
resource links
links in on a page
Global objects
Fragments (1)
Fragments (2)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
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.
Configuration
CORS prevention
add to pom.xml
Spring security in Thymeleaf
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)
Lombok
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
Swagger
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
Jenkins file
Questions
Spring Forward Starter
https://bitbucket.org/flinden68/spring-forward-starter
Reach out to me
@flinden68
https://www.elstarit.nl
flinden68@elstarit.nl
https://nl.linkedin.com/in/flinden68
https://github.com/flinden68
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/
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

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

A brief intro to nodejs
A brief intro to nodejsA brief intro to nodejs
A brief intro to nodejs
 
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
 
Introduction to Phoenix Web Framework
Introduction to Phoenix Web FrameworkIntroduction to Phoenix Web Framework
Introduction to Phoenix Web Framework
 
SymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkySymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSky
 
Developing Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring CloudDeveloping Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring Cloud
 
Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
 
Keep Applications Online
Keep Applications OnlineKeep Applications Online
Keep Applications Online
 
Building a Google Cloud Firestore API with dotnet core
Building a Google Cloud Firestore API with dotnet coreBuilding a Google Cloud Firestore API with dotnet core
Building a Google Cloud Firestore API with dotnet core
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
Container Orchestration for .NET Developers
Container Orchestration for .NET DevelopersContainer Orchestration for .NET Developers
Container Orchestration for .NET Developers
 
Let's server your Data
Let's server your DataLet's server your Data
Let's server your Data
 
Continuous delivery of your legacy application
Continuous delivery of your legacy applicationContinuous delivery of your legacy application
Continuous delivery of your legacy application
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClass
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
 
Build PWA with Ionic Toolkit
Build PWA with Ionic ToolkitBuild PWA with Ionic Toolkit
Build PWA with Ionic Toolkit
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
Introduction to OWIN
Introduction to OWINIntroduction to OWIN
Introduction to OWIN
 
Realtime with websockets
Realtime with websocketsRealtime with websockets
Realtime with websockets
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with Fiddler
 
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas VochtenO365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
 

Similar a NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (XPages) developers

Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
Vincent Partington
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
seleniumconf
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
Maarten Smeets
 

Similar a NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (XPages) developers (20)

Spring forward: an introduction to Spring boot and Thymeleaf
Spring forward: an introduction to Spring boot and ThymeleafSpring forward: an introduction to Spring boot and Thymeleaf
Spring forward: an introduction to Spring boot and Thymeleaf
 
Securing applications
Securing applicationsSecuring applications
Securing applications
 
Securing Legacy CFML Code
Securing Legacy CFML CodeSecuring Legacy CFML Code
Securing Legacy CFML Code
 
Stackato
StackatoStackato
Stackato
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Stackato v3
Stackato v3Stackato v3
Stackato v3
 
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
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
Introduction to Dependency Injection
Introduction to Dependency InjectionIntroduction to Dependency Injection
Introduction to Dependency Injection
 
CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
 
Play 2 Java Framework with TDD
Play 2 Java Framework with TDDPlay 2 Java Framework with TDD
Play 2 Java Framework with TDD
 
Play2 Java
Play2 JavaPlay2 Java
Play2 Java
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production Parity
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
 
Stackato v2
Stackato v2Stackato v2
Stackato v2
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoSocial Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 

Más de Frank van der Linden

how to connect your app to the activity stream with x-pages
how to connect your app to the activity stream with x-pageshow to connect your app to the activity stream with x-pages
how to connect your app to the activity stream with x-pages
Frank van der Linden
 
Domino point2012 integrate domino designer with cvs source control
Domino point2012 integrate domino designer with cvs source controlDomino point2012 integrate domino designer with cvs source control
Domino point2012 integrate domino designer with cvs source control
Frank van der Linden
 

Más de Frank van der Linden (20)

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
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...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...Engage 2019: The good, the bad and the ugly: a not so objective view on front...
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
Social connections14: Super charge your API’s with Reactive streamsSocial connections14: Super charge your API’s with Reactive streams
Social connections14: Super charge your API’s with Reactive streams
 
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
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...
Wcs-1785 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...
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...
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
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 - MeetITA (XPages) developers guide to Cloudant - MeetIT
A (XPages) developers guide to Cloudant - MeetIT
 
A (XPages) developers guide to Cloudant
A (XPages) developers guide to CloudantA (XPages) developers guide to Cloudant
A (XPages) developers guide to Cloudant
 
Let's serve your data
Let's serve your dataLet's serve your data
Let's serve your data
 
Don't worry with bower
Don't worry with bowerDon't worry with bower
Don't worry with bower
 
Bccon use notes objects in memory and other useful
Bccon   use notes objects in memory and other usefulBccon   use notes objects in memory and other useful
Bccon use notes objects in memory and other useful
 
Use notes objects in memory and other useful java tips for xpages development
Use notes objects in memory and other useful java tips for xpages developmentUse notes objects in memory and other useful java tips for xpages development
Use notes objects in memory and other useful java tips for xpages development
 
An XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on DominoAn XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on Domino
 
The power of dots
The power of dotsThe power of dots
The power of dots
 
Let me introduce you: DOTS
Let me introduce you: DOTSLet me introduce you: DOTS
Let me introduce you: DOTS
 
Integrate domino designer with cvs source control
Integrate domino designer with cvs source controlIntegrate domino designer with cvs source control
Integrate domino designer with cvs source control
 
how to connect your app to the activity stream with x-pages
how to connect your app to the activity stream with x-pageshow to connect your app to the activity stream with x-pages
how to connect your app to the activity stream with x-pages
 
Uklug2012 yellow and blue stream
Uklug2012 yellow and blue streamUklug2012 yellow and blue stream
Uklug2012 yellow and blue stream
 
Domino point2012 integrate domino designer with cvs source control
Domino point2012 integrate domino designer with cvs source controlDomino point2012 integrate domino designer with cvs source control
Domino point2012 integrate domino designer with cvs source control
 
Dnug2012 yellow and blue stream
Dnug2012 yellow and blue streamDnug2012 yellow and blue stream
Dnug2012 yellow and blue stream
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (XPages) developers