SlideShare uma empresa Scribd logo
1 de 43
The Eureka Moment:
 The JSF Knowledge You Need To
       Understand XPages




            Paul Withers – Intec Systems Ltd
Agenda
Introduction
XPages Server Processing
JVM and the NSF
Memory Management
JSF Event Model
Summary
About Me
Senior Domino Developer, Intec Systems Ltd
XPages Developer since 8.5.0
IBM Champion
Co-Host of The XCast
Why This Session?
Nothing in life is to be feared, it is only to be understood. Now
  is the time to understand more, so that we may fear less.
                                                        Marie Curie
A matter that becomes clear ceases to concern us.
                                              Friedrich Nietzsche
Furious activity is no substitute for understanding.
                                                    H.H. Williams
No. I am your father.                                  Darth Vader
Expectations
You should:
  Know what XPages are
  Know that XPages runs on a Domino Server
  Know the Computed Field, Edit Box, Repeat controls
You don't:
  Have a thorough understanding of JSF
  Have expert knowledge of dataContexts, managed
   beans, PhaseListeners and VariableResolvers
Agenda
Introduction
XPages Server Processing
JVM and the NSF
Memory Management
JSF Event Model
Summary
Server Architecture




  Java Virtual Machine

 XSP Command Manager

  Domino HTTP Server
So When an XPage Is Served...
Can HTTP Server resolve the URL?
  HTTP 404 Error
Does user have access to NSF?
  HTTP Authentication Page
Can HTTP Server find resource in the NSF?
  HTTP 404 Error
So When an XPage Is Served...
Does the signer have access to run XPages?
  HTTP 403 Error
Are there SSJS errors?
  XSP Command Manager takes over
  HTTP 500 error
Return XPage
XPiNC
Server-based NSFs need a local XSP
 Command Manager etc.
XPages Extensions, Java packages must be
 deployed locally
Authentication via Notes logon on local PC
Signer access granted via ECL on local PC
Logging accessible from Help → Support →
 View Log on local PC
Agenda
Introduction
XPages Server Processing
JVM and the NSF
Memory Management
JSF Event Model
Summary
Java Virtual Machine Means...
Each NSF is a separate Java application
sessionScope is per NSF
  Browser session, NOT user session
  Setting sessionScope in Db1.nsf does NOT set
   sessionScope in Db2.nsf
sessionScope is ONLY within JVM – not
  cleared by HTTP logout
JAVA Virtual Machine
XPages → Java classes → Java bytecode
Each control is a Java class
Extensions are pre-packaged Java classes
  Define properties (what can be customised)
  Define renderers (what is printed)
SSJS code is String passed to Java method
Java code prints HTML to browser
XPages Control Languages
Literal values
  Strings, booleans etc
Expression Language
  #{document1.FirstName}
SSJS
  #{javascript:document1.getItemValueString(“FirstName”)}
Custom
  All of the above
DEMO
Performance of Languages
The fewer controls the better
= less Java code to be run
Reason for Extension Library controls
  Combines multiple controls into one Java class
Combining languages is good
EL is quicker than SSJS
Agenda
Introduction
XPages Server Processing
JVM and the NSF
Memory Management
JSF Event Model
Summary
JSF and Serialization
HTTP is state-less
JSF keeps state-full server representation of
 UI (component tree or view)
Objects stored in component tree must be
 serializable (persist between requests)
  Domino objects recycled after each request
  Datasources are recycle-safe
Persistence options
Component tree (map of XPage on server)
  either held in memory of JVM
  or serialized to disk
xsp.persistence.XXX properties
See persistence tab of new xsp.properties
 editor
Package Explorer → WebContentWEB-
 INFxsp.properties
Persistence
Demo
Agenda
Introduction
XPages Server Processing
JVM and the NSF
Memory Management
JSF Event Model
Summary
JSF LifeCycle
Six Phases
Restore View
  JSF component tree retrieved
Apply Request Values
  this.setSubmittedValue(passedValue) run
  Any event logic run if immediate=“true”
Process Validation
  Any converters applied
  Any validators applied
Six Phases Continued
Update Model Values
  this.setValue(this.getSubmittedValue());
  this.setSubmittedValue(null)
Invoke Application
  Any event logic run
Render Response
  HTML rendered and state saved
  Only event that runs during page load
AbstractPhaseListener
Abstract because it can't be instantiated
Implements javax.faces.event.PhaseListener
Allows us to track JSF lifecycle phases
Java class plus reference in faces-config
DEMO
Basic Processing
Validation fails
  beforeRestoreView
  afterRestoreView
  beforeApplyRequestValues
  afterApplyRequestValues
  beforeProcessValidations
  beforeRenderResponse
  afterRenderResponse
Event logic not run
No Validation
Conversion still honoured
  If failed, skips from ProcessValidations to RenderResponse
  Event Logic not run
If no conversion errors, all phases run
Values passed from submittedValue to value
Component tree updated
immediate=“true”
Validation fails
   beforeRestoreView
   afterRestoreView
   beforeApplyRequestValues
   afterApplyRequestValues
   beforeRenderResponse
   afterRenderResponse
Event logic run in ApplyRequestValues phase
Component value never goes past submittedValue
Component tree not updated
Performance Smackdown
Compute on Page Load (Loaded)
Compute Dynamically (Runtime)
Theme
dataContexts
  “Global variables”
  Scoped to XPage, Custom Control, Panel
  Referenced via EL – #{var1}
Performance Smackdown
Page Load – how many calls
Partial Refresh – how many calls
execMode=“partial”
  Runs over only part of component tree
DEMO
Smackdown Results
Loaded makes fewer calls
Theme cannot override loaded
Runtime and theme makes same calls
dataContext makes fewer calls
execMode=“partial” improves performance
  IMPORTANT: Define id to execute lifecycle on
     EventHandler – All Properties
Bonus – Repeats Revisited
See Bonus – Java Performance + Rendered
  rendered property set for each of 50000 rows
SSJS in Script Library performs worst
SL much worse on partial refresh
VariableResolver best for performance
  Deprecated in JSF 2.0 for ELResolver
DataContext next best (rendered property), but
 only reusable within page
Summary
Scoped variables not cleared by ?logout
Combining controls improves performance
Persistence options can optimise application
JSF lifecycle affects event processing
Loaded and dataContexts offer benefits
execMode improves performance
Summary
Script libraries work for application reusability
dataContexts better for page reusability
VariableResolver best for application-level
 reusability
Upgrade VariableResolver to ELResolver
 when XPages updated to JSF 2.0
Use AbstractPhaseListener to test
Combining Controls Results
Language Lifecycle Results
Code Location Results
To Download Sample App
Source code at
 http://projects.qtzar.com/projects/jsf_eureka
Source control with Git
Download and install eGit from OpenNTF
Create new project from source code
Associate with new NSF
Thank You, Questions & Evals



Paul Withers, Intec Systems Ltd
Email: pwithers@intec.co.uk
Twitter: paulswithers
Blog: www.intec.co.uk/blog
        Please complete evaluations

Mais conteúdo relacionado

Mais procurados

Life in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPagesLife in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPages
Ulrich Krause
 
Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1 Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1
Shreedhar Ganapathy
 

Mais procurados (20)

Life In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPagesLife In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPages
 
Life in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPagesLife in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPages
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJB
 
Writing Stored Procedures with Oracle Database 12c
Writing Stored Procedures with Oracle Database 12cWriting Stored Procedures with Oracle Database 12c
Writing Stored Procedures with Oracle Database 12c
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?
 
미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기
 
Writing Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12cWriting Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12c
 
Java, Ruby & Rails
Java, Ruby & RailsJava, Ruby & Rails
Java, Ruby & Rails
 
OpenNTF Domino API - Overview Introduction
OpenNTF Domino API - Overview IntroductionOpenNTF Domino API - Overview Introduction
OpenNTF Domino API - Overview Introduction
 
High Availability Perl DBI + MySQL
High Availability Perl DBI + MySQLHigh Availability Perl DBI + MySQL
High Availability Perl DBI + MySQL
 
Java EE and Google App Engine
Java EE and Google App EngineJava EE and Google App Engine
Java EE and Google App Engine
 
Jvm mbeans jmxtran
Jvm mbeans jmxtranJvm mbeans jmxtran
Jvm mbeans jmxtran
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 
Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1 Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
VMware Automation, PowerCLI presented at the Northern California PSUG
VMware Automation, PowerCLI presented at the Northern California PSUGVMware Automation, PowerCLI presented at the Northern California PSUG
VMware Automation, PowerCLI presented at the Northern California PSUG
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Java EE 7, what's in it for me?
Java EE 7, what's in it for me?
 
Beyond the Basics 4 MongoDB Security and Authentication
Beyond the Basics 4 MongoDB Security and AuthenticationBeyond the Basics 4 MongoDB Security and Authentication
Beyond the Basics 4 MongoDB Security and Authentication
 

Destaque

Hum2250 sm2016 chicago film response
Hum2250 sm2016 chicago film responseHum2250 sm2016 chicago film response
Hum2250 sm2016 chicago film response
ProfWillAdams
 
Regla de tildación parte ii
Regla de tildación  parte iiRegla de tildación  parte ii
Regla de tildación parte ii
capeco1a
 
Hum2250 sm2016 research project description
Hum2250 sm2016 research project descriptionHum2250 sm2016 research project description
Hum2250 sm2016 research project description
ProfWillAdams
 
Ms2006
Ms2006Ms2006
Ms2006
amdii
 
2 princ de eng ¬ fab - metrologia industrial - aulas uema
2 princ de eng ¬ fab - metrologia industrial - aulas uema2 princ de eng ¬ fab - metrologia industrial - aulas uema
2 princ de eng ¬ fab - metrologia industrial - aulas uema
ffilipelima
 
Diagnostico de la comunidad
Diagnostico de la comunidadDiagnostico de la comunidad
Diagnostico de la comunidad
Emilio Cardona
 
Baixa Idade Média, Idade Moderna e Colônia portuguesa
Baixa Idade Média, Idade Moderna e Colônia portuguesaBaixa Idade Média, Idade Moderna e Colônia portuguesa
Baixa Idade Média, Idade Moderna e Colônia portuguesa
BriefCase
 

Destaque (20)

Prueba
PruebaPrueba
Prueba
 
Hum2250 sm2016 chicago film response
Hum2250 sm2016 chicago film responseHum2250 sm2016 chicago film response
Hum2250 sm2016 chicago film response
 
Cars Online 11/12 - Changing dynamics drive new in technology and business mo...
Cars Online 11/12 - Changing dynamics drive new in technology and business mo...Cars Online 11/12 - Changing dynamics drive new in technology and business mo...
Cars Online 11/12 - Changing dynamics drive new in technology and business mo...
 
Trash to treasure 28 recycled crafts
Trash to treasure 28 recycled craftsTrash to treasure 28 recycled crafts
Trash to treasure 28 recycled crafts
 
CóMo Buscar Empleo Por Internet
CóMo Buscar Empleo Por InternetCóMo Buscar Empleo Por Internet
CóMo Buscar Empleo Por Internet
 
Guia arte para titas 1
Guia arte para titas 1Guia arte para titas 1
Guia arte para titas 1
 
Me declaro \"Vivo\"
Me declaro \"Vivo\"Me declaro \"Vivo\"
Me declaro \"Vivo\"
 
Curation en Entreprise avec Knowledge Plaza
Curation en Entreprise avec Knowledge PlazaCuration en Entreprise avec Knowledge Plaza
Curation en Entreprise avec Knowledge Plaza
 
Regla de tildación parte ii
Regla de tildación  parte iiRegla de tildación  parte ii
Regla de tildación parte ii
 
Museu e comunidade
Museu e comunidadeMuseu e comunidade
Museu e comunidade
 
Hum2250 sm2016 research project description
Hum2250 sm2016 research project descriptionHum2250 sm2016 research project description
Hum2250 sm2016 research project description
 
Appetito ristorante
Appetito ristoranteAppetito ristorante
Appetito ristorante
 
Advertising world wide stunts 2011 |Q2
Advertising world wide stunts 2011 |Q2 Advertising world wide stunts 2011 |Q2
Advertising world wide stunts 2011 |Q2
 
Ms2006
Ms2006Ms2006
Ms2006
 
BRYULLOV, Karl Pavlovich,Featured Paintings in Detail
BRYULLOV, Karl Pavlovich,Featured Paintings in DetailBRYULLOV, Karl Pavlovich,Featured Paintings in Detail
BRYULLOV, Karl Pavlovich,Featured Paintings in Detail
 
2 princ de eng ¬ fab - metrologia industrial - aulas uema
2 princ de eng ¬ fab - metrologia industrial - aulas uema2 princ de eng ¬ fab - metrologia industrial - aulas uema
2 princ de eng ¬ fab - metrologia industrial - aulas uema
 
Cementerio la Almudena Cusco-Perú
Cementerio la Almudena Cusco-PerúCementerio la Almudena Cusco-Perú
Cementerio la Almudena Cusco-Perú
 
El incendio de Santander 1941
El incendio de Santander  1941El incendio de Santander  1941
El incendio de Santander 1941
 
Diagnostico de la comunidad
Diagnostico de la comunidadDiagnostico de la comunidad
Diagnostico de la comunidad
 
Baixa Idade Média, Idade Moderna e Colônia portuguesa
Baixa Idade Média, Idade Moderna e Colônia portuguesaBaixa Idade Média, Idade Moderna e Colônia portuguesa
Baixa Idade Média, Idade Moderna e Colônia portuguesa
 

Semelhante a Eureka moment

Web Sphere Problem Determination Ext
Web Sphere Problem Determination ExtWeb Sphere Problem Determination Ext
Web Sphere Problem Determination Ext
Rohit Kelapure
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
Mert Çalışkan
 
Teaching old java script new tricks
Teaching old java script new tricksTeaching old java script new tricks
Teaching old java script new tricks
Simon Sturmer
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
hamzadamani7
 

Semelhante a Eureka moment (20)

IBM ConnectED 2015 - MAS103 XPages Performance and Scalability
IBM ConnectED 2015 - MAS103 XPages Performance and ScalabilityIBM ConnectED 2015 - MAS103 XPages Performance and Scalability
IBM ConnectED 2015 - MAS103 XPages Performance and Scalability
 
XPages Performance
XPages PerformanceXPages Performance
XPages Performance
 
Copper: A high performance workflow engine
Copper: A high performance workflow engineCopper: A high performance workflow engine
Copper: A high performance workflow engine
 
JSF 2.0 Preview
JSF 2.0 PreviewJSF 2.0 Preview
JSF 2.0 Preview
 
Web Sphere Problem Determination Ext
Web Sphere Problem Determination ExtWeb Sphere Problem Determination Ext
Web Sphere Problem Determination Ext
 
Monitoring and Tuning GlassFish
Monitoring and Tuning GlassFishMonitoring and Tuning GlassFish
Monitoring and Tuning GlassFish
 
Monitoring And Tuning Glass Fish In The Wild Community One 2009
Monitoring And Tuning Glass Fish In The Wild   Community One 2009Monitoring And Tuning Glass Fish In The Wild   Community One 2009
Monitoring And Tuning Glass Fish In The Wild Community One 2009
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
Java server face tutorial
Java server face tutorialJava server face tutorial
Java server face tutorial
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
 
Teaching old java script new tricks
Teaching old java script new tricksTeaching old java script new tricks
Teaching old java script new tricks
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
 
Jsfsunum
JsfsunumJsfsunum
Jsfsunum
 
Jsfsunum
JsfsunumJsfsunum
Jsfsunum
 
Panama.pdf
Panama.pdfPanama.pdf
Panama.pdf
 
Resthub
ResthubResthub
Resthub
 
JSF and Seam
JSF and SeamJSF and Seam
JSF and Seam
 
WSO2 Internsip Period
WSO2 Internsip PeriodWSO2 Internsip Period
WSO2 Internsip Period
 
Java EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's QuarrelJava EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's Quarrel
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
 

Mais de Paul Withers

Mais de Paul Withers (20)

Engage 2019: Introduction to Node-Red
Engage 2019: Introduction to Node-RedEngage 2019: Introduction to Node-Red
Engage 2019: Introduction to Node-Red
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
 
Engage 2019: AI What Is It Good For
Engage 2019: AI What Is It Good ForEngage 2019: AI What Is It Good For
Engage 2019: AI What Is It Good For
 
Social Connections 14 - ICS Integration with Node-RED and Open Source
Social Connections 14 - ICS Integration with Node-RED and Open SourceSocial Connections 14 - ICS Integration with Node-RED and Open Source
Social Connections 14 - ICS Integration with Node-RED and Open Source
 
ICONUK 2018 - Do You Wanna Build a Chatbot
ICONUK 2018 - Do You Wanna Build a ChatbotICONUK 2018 - Do You Wanna Build a Chatbot
ICONUK 2018 - Do You Wanna Build a Chatbot
 
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
 
IBM Think Session 3249 Watson Work Services Java SDK
IBM Think Session 3249 Watson Work Services Java SDKIBM Think Session 3249 Watson Work Services Java SDK
IBM Think Session 3249 Watson Work Services Java SDK
 
GraphQL 101
GraphQL 101GraphQL 101
GraphQL 101
 
GraphQL 101
GraphQL 101GraphQL 101
GraphQL 101
 
OpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentOpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino Development
 
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoSocial Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
 
ICON UK 2015 - ODA and CrossWorlds
ICON UK 2015 - ODA and CrossWorldsICON UK 2015 - ODA and CrossWorlds
ICON UK 2015 - ODA and CrossWorlds
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
 
Engage 2014 OpenNTF Domino API Slides
Engage 2014 OpenNTF Domino API SlidesEngage 2014 OpenNTF Domino API Slides
Engage 2014 OpenNTF Domino API Slides
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
 
Embracing the power of the notes client
Embracing the power of the notes clientEmbracing the power of the notes client
Embracing the power of the notes client
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
 

Último

Último (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
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...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 

Eureka moment

  • 1. The Eureka Moment: The JSF Knowledge You Need To Understand XPages Paul Withers – Intec Systems Ltd
  • 2. Agenda Introduction XPages Server Processing JVM and the NSF Memory Management JSF Event Model Summary
  • 3. About Me Senior Domino Developer, Intec Systems Ltd XPages Developer since 8.5.0 IBM Champion Co-Host of The XCast
  • 4. Why This Session? Nothing in life is to be feared, it is only to be understood. Now is the time to understand more, so that we may fear less. Marie Curie A matter that becomes clear ceases to concern us. Friedrich Nietzsche Furious activity is no substitute for understanding. H.H. Williams No. I am your father. Darth Vader
  • 5. Expectations You should: Know what XPages are Know that XPages runs on a Domino Server Know the Computed Field, Edit Box, Repeat controls You don't: Have a thorough understanding of JSF Have expert knowledge of dataContexts, managed beans, PhaseListeners and VariableResolvers
  • 6. Agenda Introduction XPages Server Processing JVM and the NSF Memory Management JSF Event Model Summary
  • 7. Server Architecture Java Virtual Machine XSP Command Manager Domino HTTP Server
  • 8. So When an XPage Is Served... Can HTTP Server resolve the URL? HTTP 404 Error Does user have access to NSF? HTTP Authentication Page Can HTTP Server find resource in the NSF? HTTP 404 Error
  • 9. So When an XPage Is Served... Does the signer have access to run XPages? HTTP 403 Error Are there SSJS errors? XSP Command Manager takes over HTTP 500 error Return XPage
  • 10. XPiNC Server-based NSFs need a local XSP Command Manager etc. XPages Extensions, Java packages must be deployed locally Authentication via Notes logon on local PC Signer access granted via ECL on local PC Logging accessible from Help → Support → View Log on local PC
  • 11. Agenda Introduction XPages Server Processing JVM and the NSF Memory Management JSF Event Model Summary
  • 12. Java Virtual Machine Means... Each NSF is a separate Java application sessionScope is per NSF Browser session, NOT user session Setting sessionScope in Db1.nsf does NOT set sessionScope in Db2.nsf sessionScope is ONLY within JVM – not cleared by HTTP logout
  • 13. JAVA Virtual Machine XPages → Java classes → Java bytecode Each control is a Java class Extensions are pre-packaged Java classes Define properties (what can be customised) Define renderers (what is printed) SSJS code is String passed to Java method Java code prints HTML to browser
  • 14. XPages Control Languages Literal values Strings, booleans etc Expression Language #{document1.FirstName} SSJS #{javascript:document1.getItemValueString(“FirstName”)} Custom All of the above
  • 15. DEMO
  • 16. Performance of Languages The fewer controls the better = less Java code to be run Reason for Extension Library controls Combines multiple controls into one Java class Combining languages is good EL is quicker than SSJS
  • 17. Agenda Introduction XPages Server Processing JVM and the NSF Memory Management JSF Event Model Summary
  • 18. JSF and Serialization HTTP is state-less JSF keeps state-full server representation of UI (component tree or view) Objects stored in component tree must be serializable (persist between requests) Domino objects recycled after each request Datasources are recycle-safe
  • 19.
  • 20. Persistence options Component tree (map of XPage on server) either held in memory of JVM or serialized to disk xsp.persistence.XXX properties See persistence tab of new xsp.properties editor Package Explorer → WebContentWEB- INFxsp.properties
  • 22. Demo
  • 23. Agenda Introduction XPages Server Processing JVM and the NSF Memory Management JSF Event Model Summary
  • 25. Six Phases Restore View JSF component tree retrieved Apply Request Values this.setSubmittedValue(passedValue) run Any event logic run if immediate=“true” Process Validation Any converters applied Any validators applied
  • 26. Six Phases Continued Update Model Values this.setValue(this.getSubmittedValue()); this.setSubmittedValue(null) Invoke Application Any event logic run Render Response HTML rendered and state saved Only event that runs during page load
  • 27. AbstractPhaseListener Abstract because it can't be instantiated Implements javax.faces.event.PhaseListener Allows us to track JSF lifecycle phases Java class plus reference in faces-config
  • 28. DEMO
  • 29. Basic Processing Validation fails beforeRestoreView afterRestoreView beforeApplyRequestValues afterApplyRequestValues beforeProcessValidations beforeRenderResponse afterRenderResponse Event logic not run
  • 30. No Validation Conversion still honoured If failed, skips from ProcessValidations to RenderResponse Event Logic not run If no conversion errors, all phases run Values passed from submittedValue to value Component tree updated
  • 31. immediate=“true” Validation fails beforeRestoreView afterRestoreView beforeApplyRequestValues afterApplyRequestValues beforeRenderResponse afterRenderResponse Event logic run in ApplyRequestValues phase Component value never goes past submittedValue Component tree not updated
  • 32. Performance Smackdown Compute on Page Load (Loaded) Compute Dynamically (Runtime) Theme dataContexts “Global variables” Scoped to XPage, Custom Control, Panel Referenced via EL – #{var1}
  • 33. Performance Smackdown Page Load – how many calls Partial Refresh – how many calls execMode=“partial” Runs over only part of component tree
  • 34. DEMO
  • 35. Smackdown Results Loaded makes fewer calls Theme cannot override loaded Runtime and theme makes same calls dataContext makes fewer calls execMode=“partial” improves performance IMPORTANT: Define id to execute lifecycle on EventHandler – All Properties
  • 36. Bonus – Repeats Revisited See Bonus – Java Performance + Rendered rendered property set for each of 50000 rows SSJS in Script Library performs worst SL much worse on partial refresh VariableResolver best for performance Deprecated in JSF 2.0 for ELResolver DataContext next best (rendered property), but only reusable within page
  • 37. Summary Scoped variables not cleared by ?logout Combining controls improves performance Persistence options can optimise application JSF lifecycle affects event processing Loaded and dataContexts offer benefits execMode improves performance
  • 38. Summary Script libraries work for application reusability dataContexts better for page reusability VariableResolver best for application-level reusability Upgrade VariableResolver to ELResolver when XPages updated to JSF 2.0 Use AbstractPhaseListener to test
  • 42. To Download Sample App Source code at http://projects.qtzar.com/projects/jsf_eureka Source control with Git Download and install eGit from OpenNTF Create new project from source code Associate with new NSF
  • 43. Thank You, Questions & Evals Paul Withers, Intec Systems Ltd Email: pwithers@intec.co.uk Twitter: paulswithers Blog: www.intec.co.uk/blog Please complete evaluations

Notas do Editor

  1. Human nature is to resist what is new because we don't understand it. Lots of new things going on behind scenes in XPages. This session will demystify some. Who has struggled with a problem for hours, then found one piece of information that would have given you the answer straight away, if you'd known it? That's the Eureka moment: one crucial piece of info that explains everything.
  2. If you attended Intro to XPages session, you will be able to keep up with this session. If you didn't go because you knew it, you'll be able to keep up with this session. If you know what a VariableResolver is, how to code one, why you might need to change it in the future, go get a beer!
  3. Traditional Domino web apps used HTTP server. Java servlets used JVM XPages uses both How? When?
  4. HTTP 500 if fatal error with XPages runtime - memory issue - Extension Library used by app but not installed - Java class cannot be loaded (NoClassDefFoundError) - Other database compile issue
  5. XPINC IS LOCAL EVEN IF NSF IS ON SERVER
  6. Who wants a demo? NOTE SPECIFICALLY sessionScope.sessionID
  7. Summary of demo
  8. Jump to Application Perspective – Package Explorer – Project Explorer Java code does the same as an Xagent - facesContext,getResponseWriter() - writer.write()
  9. Based on previous slides, what will happen? If we split languages across controls, so controls with single language? If we combine literal values and A.N.Other language? If we use different languages?
  10. Summary of demo
  11. If you want to store / pass info between requests - Add to QueryString - Store in cookies - Pass in AJAX request in response JSF handles this – we've seen sessionID cookie and JSF sessionID in sessionScope. This ensures same session is used Recycle-safe, i.e. values are stored in Java beans and written back to the server as and when required. We'll come back tot hat later.
  12. If you want to store / pass info between requests - Add to QueryString - Store in cookies - Pass in AJAX request in response JSF handles this – we've seen sessionID cookie and JSF sessionID in sessionScope. This ensures same session is used Recycle-safe, i.e. values are stored in Java beans and written back to the server as and when required. We'll come back tot hat later.
  13. Screenshots of new Persistence tab of xsp.properties file Server Page Persistence – see demo Page Persistence Mode
  14. If immediate = “true” and using component values, need to use getComponent(“myComponent”).getSubmittedValue()
  15. If NOT using immediate = “true” and using component values, need to use getComponent(“myComponent”).getValue()
  16. In the following demos, I'm using an AbstractPhaseListener to check what's happening where
  17. Let's see what happens during page events
  18. Summary of results of JSF Lifecycle - Basic
  19. Summary of results of JSF Lifecycle – No Validation
  20. Summary of results of JSF Lifecycle - Immediate
  21. Let's see what happens depending on where Computed Field value property and Edit Box rendered property are defined
  22. Summary of demo