SlideShare a Scribd company logo
••
                                            ••
                                                 ••
                                                      ••




                                                                                           What is JSF?
                                                           ••
                                                                ••
                                                                     ••
                                                                          •••
                                                                                ••••
                                                                                       •••••••••


  What is JSF?



                             Roosendaal - 22/09/2005

                             Gie Indesteege - ABIS Training & Consulting

                             gindesteege@abis.be




ABIS Training & Consulting                                                        1
JavaServer Faces (JSF)




                                 What is JSF?
• Web frameworks
• JSF terminology
• JSF life cycle
• Web development with JSF
• Q&A




What is JSF?                 2
Web frameworks




                                                                 What is JSF?
Strong requirements needed for e-business applications:
    scalability, availability, security, flexibility, ...

No chances taken -> use reliable, well supported framework
• separation of concerns
• layering
• container/component
• extensible
• active community/active development
• standards based




What is JSF?                                                 3
Model View Controller framework




                                                                                  What is JSF?
                          Request
                                       Servlet
               Browser

                                           Controller

                                                                Logic

                                                   JavaBean             EIS
                    Response

                                     JSP                Model


                                    View


• Controller servlet regulates navigation
• JavaBean provides/accesses business logic
• JavaServer Page (JSP) creates presentation/view

What is JSF?                                                                  4
JSF goes beyond MVC (model 2)




                                                                                           What is JSF?
                                                        invoke
                                   FacesServlet                  action method




                           t
                          es
                     qu
                    re
                                                  faces-



                                     select
                                                config.xml
          Browser                                                                EIS
                                                                   JavaBean
                    res
                         po
                           ns
                               e
                                              JSP




• mainly view framework
• obtain configuration from external source (i.e. XML file)
• use Request Handlers as Commands to delegate control

What is JSF?                                                                           5
JSF architecture




                            What is JSF?
(JSF 1.0)




API’s
• JSF (javax.faces.*)
• JSTL
• Apache Commons

What is JSF?            6
JSF framework




                                                                         What is JSF?
Important characteristics:
• stateful UI component model
    - separation of presentation (rendering),
        mark-up generation (HTML, WML, XML, ...)
    - and business logic -> integration with model objects (JavaBeans)
• processing of client-side events (at server side)
• extensible type conversion system
• form handling and validation




What is JSF?                                                         7
Advantages of JSF




                                                                           What is JSF?
• official Java standard JSF 1.0 - JSR 127
        JSR 252: JavaServer Faces 1.2 - Proposed Final Draft (22/8/2005)
• easier to create multi-channel architectures
    - not restricted to JSP (HTML)
• event handling (server side)
• Swing-like GUI creation possible
• Internationalisation


http://java.sun.com/j2ee/javaserverfaces/




What is JSF?                                                           8
JavaServer Faces (JSF)




                                 What is JSF?
• Web frameworks
• JSF terminology
• JSF life cycle
• Web development with JSF
• Q&A




What is JSF?                 9
JSF terminology




                                                                   What is JSF?
Faces servlet
    - controller servlet, part of the JSF framework

Faces configuration (faces-config.xml)
    - configuration of web application under control of JSF
    - (page) navigation rules
    - managed beans (bean under control of JSF framework)

Faces JavaServer Pages
    - special tag libraries (core, html, ...)
    - faces expression language




What is JSF?                                                  10
JSF terminology (cont.)




                                                                       What is JSF?
Faces (UI) components
    - standard set of graphical widgets and controls (stateful)
    - based on JavaBeans
    - associated with renderer
    - organised in tree structure (per JSP)




What is JSF?                                                      11
JavaServer Faces (JSF)




                                  What is JSF?
• Web frameworks
• JSF terminology
• JSF life cycle
• Web development with JSF
• Q&A




What is JSF?                 12
JSF life cycle




                                                  What is JSF?
There are 6 phases in the JSF life cycle:
• Reconstitute request tree (restore view)
• Apply request values
• Process validations
• Update model values
• Invoke application
• Render response




What is JSF?                                 13
JSF life cycle (part 1)




                                               What is JSF?
No application data passed

                         JSF Framework

                            Restore
               Request       view


                                no data


                            Render
          Response         response




What is JSF?                              14
JSF life cycle (part 2)




                                                                         What is JSF?
Use of (HTML) form data

                          JSF Framework

                             Restore       ...
                Request       view


                                 no data


                                                       Update
                             Render        ...         model
               Response     response
                                                       values




UI components organised in hierarchical tree per JSP

bind input fields to business data in backing bean (managed bean)


What is JSF?                                                        15
JSF life cycle (part 3)




                                                                        What is JSF?
Navigation between pages (static vs. dynamic)
                          JSF Framework

                             Restore            ...
                Request       view


                                 no data


                                                          Update
                             Render           Invoke
                                                          model
               Response     response        application
                                                          values




rules in configuration file (faces-config.xml)
<navigation-rule>
  <from-view-id>/index.jsp</from-view-id>
  <navigation-case>
   <from-outcome>success</from-outcome>
   <to-view-id>/welcome.jsp</to-view-id>
  </navigation-case>


What is JSF?                                                       16
JSF life cycle (part 4)




                                                                                                  What is JSF?
Validation

                          JSF Framework

                                           Apply
                              Restore                              Process
                                          request
                Request        view                               validations
                                           values
                           no data                                     validation
                                                                         error

                                                                                    Update
                              Render                  Invoke
                                                                                    model
               Response      response               application
                                                                                    values




• syntax -> faces validators working on data in UI components
• business -> logic accessing model values in managed beans

Error messages via FacesMessage objects and special tags in JSP

What is JSF?                                                                                 17
JSF life cycle (final)




                                                                                                           What is JSF?
Event handling
                                 JSF Framework

                                                    Apply request values     Process validations
                                     Restore
                                                                                        PVE
                Request               view
                                                      PVE          AE
                                                                             immediate input
                                          no data      immediate command             convervion/
                                                                                   validation error

                                                      Invoke application
                                     Render                                          Update model
                                                              AE
               Response             response                                            values




                 PVE                                            AE
                          C   V VCL(n) VCL(a)                              AL(n)     AL(a)        A


• action events - when a command is pressed (button or link)
• process validation events- when value of an input field has changed
• input events - immediate commands - immediate input
• (pre- and post) phase events

What is JSF?                                                                                          18
JavaServer Faces (JSF)




                                  What is JSF?
• Web frameworks
• JSF terminology
• JSF life cycle
• Web development with JSF
• Q&A




What is JSF?                 19
Web development with JSF




                                                                        What is JSF?
JSF application consists of:
• JSP pages
• UI components represented as stateful objects on the server
• a custom tag library for rendering UI components
• a custom tag library for representing event handlers and validators
• JavaBeans (or model objects) containing application-specific func-
  tionality and data
• event listeners
• server-side helper classes
• validators, event handlers, and navigation handlers
• application configuration resource file faces-config.xml




What is JSF?                                                       20
Web development with JSF




                                                           What is JSF?
Native

Supported by IDE
• IBM WebSphere Studio and Rational Developer
• Sun Java Studio Creator
• Borland JBuilder
• Oracle JDeveloper
• ...

or

Integration of JSF with EGL (see next presentation)




What is JSF?                                          21
JavaServer Faces (JSF)




                                  What is JSF?
• Web frameworks
• JSF terminology
• JSF life cycle
• Web development with JSF
• Q&A




What is JSF?                 22
JavaServer Faces (JSF)




                                              What is JSF?
                             Thank you




Gie Indesteege

ABIS Training & Consulting




What is JSF?                             23

More Related Content

ODP
Development of web apps based on JSF (TU Vienna)
PDF
Understanding the nuts & bolts of Java EE 6
PDF
Andrei Niculae - JavaEE6 - 24mai2011
PDF
Java EE 6 & GlassFish v3 @ DevNexus
PDF
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
PDF
JavaEE 6 and GlassFish v3 at SFJUG
ODP
OTN Developer Days - Java EE 6
PDF
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Development of web apps based on JSF (TU Vienna)
Understanding the nuts & bolts of Java EE 6
Andrei Niculae - JavaEE6 - 24mai2011
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
JavaEE 6 and GlassFish v3 at SFJUG
OTN Developer Days - Java EE 6
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010

What's hot (20)

PDF
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
PDF
Overview of Java EE 6 by Roberto Chinnici at SFJUG
PDF
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
PDF
Java EE 6 workshop at Dallas Tech Fest 2011
PDF
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
PPT
JBoss presentation 2003 11 for matrix
PDF
Java EE 6 Component Model Explained
PDF
Java EE 6 & GlassFish 3
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
PDF
Sun Java EE 6 Overview
PDF
Java EE 6 and GlassFish v3: Paving the path for future
PDF
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
PPT
JBoss Analyst tour Sept 2003
PDF
Contextual Dependency Injection for Apachecon 2010
PDF
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
PDF
Whats Cool in Java E 6
PDF
AK 4 JSF
PDF
AK 5 JSF 21 july 2008
PDF
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
PDF
Jsf2 overview
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 workshop at Dallas Tech Fest 2011
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
JBoss presentation 2003 11 for matrix
Java EE 6 Component Model Explained
Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Sun Java EE 6 Overview
Java EE 6 and GlassFish v3: Paving the path for future
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
JBoss Analyst tour Sept 2003
Contextual Dependency Injection for Apachecon 2010
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
Whats Cool in Java E 6
AK 4 JSF
AK 5 JSF 21 july 2008
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
Jsf2 overview
Ad

Viewers also liked (14)

PPTX
PPTX
Quantriduandautu
PPTX
Marka slaskie maleogrodki-prezentacja
DOCX
Silabus smp kelas 7 allson 3 mei 2013
PPTX
Marka slaskie maleogrodki-prezentacjab
PPTX
NCP minister arrested in housing scam should quit: Munde | Business Standard
PDF
Relacje p 17-2012-05-25
DOCX
Bondronat
PPTX
Mahsc 15th anniversary power point presentation
DOCX
Hplc kompre
PPT
Mon portfolio de creation
PPTX
Relacja z działań Przedszkola nr 17 w Tychach
PDF
Materi hr strategis lan-bab 1 konsep msdm strategik
PDF
Materi hr strategis lan-bab 3 perencanaan sdm strategic
Quantriduandautu
Marka slaskie maleogrodki-prezentacja
Silabus smp kelas 7 allson 3 mei 2013
Marka slaskie maleogrodki-prezentacjab
NCP minister arrested in housing scam should quit: Munde | Business Standard
Relacje p 17-2012-05-25
Bondronat
Mahsc 15th anniversary power point presentation
Hplc kompre
Mon portfolio de creation
Relacja z działań Przedszkola nr 17 w Tychach
Materi hr strategis lan-bab 1 konsep msdm strategik
Materi hr strategis lan-bab 3 perencanaan sdm strategic
Ad

Similar to JSF-Starter (20)

PDF
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
PDF
Sun JSF Presentation
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
PDF
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
PDF
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
PDF
Java EE 6 = Less Code + More Power
PDF
Java Edge.2007.What.Is.New.In.Jsf.2
PDF
Glass Fishv3 March2010
PDF
Java EE6 Overview
PPT
JSF and Seam
PPT
Jsfsunum
DOC
J2EE Online Training
PDF
Lecture 10 - Java Server Faces (JSF)
PDF
JBoss AS7 Reloaded
PDF
Java EE 8 Web Frameworks: A Look at JSF vs MVC
PDF
Java Enterprise Edition 6 Overview
PDF
Java E
PDF
Jsf Framework
PPT
Jsf 2.0 Overview
PDF
Summer training java
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
Sun JSF Presentation
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 = Less Code + More Power
Java Edge.2007.What.Is.New.In.Jsf.2
Glass Fishv3 March2010
Java EE6 Overview
JSF and Seam
Jsfsunum
J2EE Online Training
Lecture 10 - Java Server Faces (JSF)
JBoss AS7 Reloaded
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java Enterprise Edition 6 Overview
Java E
Jsf Framework
Jsf 2.0 Overview
Summer training java

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Machine Learning_overview_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Cloud computing and distributed systems.
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
sap open course for s4hana steps from ECC to s4
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
Programs and apps: productivity, graphics, security and other tools
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25-Week II
Machine Learning_overview_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MYSQL Presentation for SQL database connectivity

JSF-Starter

  • 1. •• •• •• •• What is JSF? •• •• •• ••• •••• ••••••••• What is JSF? Roosendaal - 22/09/2005 Gie Indesteege - ABIS Training & Consulting gindesteege@abis.be ABIS Training & Consulting 1
  • 2. JavaServer Faces (JSF) What is JSF? • Web frameworks • JSF terminology • JSF life cycle • Web development with JSF • Q&A What is JSF? 2
  • 3. Web frameworks What is JSF? Strong requirements needed for e-business applications: scalability, availability, security, flexibility, ... No chances taken -> use reliable, well supported framework • separation of concerns • layering • container/component • extensible • active community/active development • standards based What is JSF? 3
  • 4. Model View Controller framework What is JSF? Request Servlet Browser Controller Logic JavaBean EIS Response JSP Model View • Controller servlet regulates navigation • JavaBean provides/accesses business logic • JavaServer Page (JSP) creates presentation/view What is JSF? 4
  • 5. JSF goes beyond MVC (model 2) What is JSF? invoke FacesServlet action method t es qu re faces- select config.xml Browser EIS JavaBean res po ns e JSP • mainly view framework • obtain configuration from external source (i.e. XML file) • use Request Handlers as Commands to delegate control What is JSF? 5
  • 6. JSF architecture What is JSF? (JSF 1.0) API’s • JSF (javax.faces.*) • JSTL • Apache Commons What is JSF? 6
  • 7. JSF framework What is JSF? Important characteristics: • stateful UI component model - separation of presentation (rendering), mark-up generation (HTML, WML, XML, ...) - and business logic -> integration with model objects (JavaBeans) • processing of client-side events (at server side) • extensible type conversion system • form handling and validation What is JSF? 7
  • 8. Advantages of JSF What is JSF? • official Java standard JSF 1.0 - JSR 127 JSR 252: JavaServer Faces 1.2 - Proposed Final Draft (22/8/2005) • easier to create multi-channel architectures - not restricted to JSP (HTML) • event handling (server side) • Swing-like GUI creation possible • Internationalisation http://java.sun.com/j2ee/javaserverfaces/ What is JSF? 8
  • 9. JavaServer Faces (JSF) What is JSF? • Web frameworks • JSF terminology • JSF life cycle • Web development with JSF • Q&A What is JSF? 9
  • 10. JSF terminology What is JSF? Faces servlet - controller servlet, part of the JSF framework Faces configuration (faces-config.xml) - configuration of web application under control of JSF - (page) navigation rules - managed beans (bean under control of JSF framework) Faces JavaServer Pages - special tag libraries (core, html, ...) - faces expression language What is JSF? 10
  • 11. JSF terminology (cont.) What is JSF? Faces (UI) components - standard set of graphical widgets and controls (stateful) - based on JavaBeans - associated with renderer - organised in tree structure (per JSP) What is JSF? 11
  • 12. JavaServer Faces (JSF) What is JSF? • Web frameworks • JSF terminology • JSF life cycle • Web development with JSF • Q&A What is JSF? 12
  • 13. JSF life cycle What is JSF? There are 6 phases in the JSF life cycle: • Reconstitute request tree (restore view) • Apply request values • Process validations • Update model values • Invoke application • Render response What is JSF? 13
  • 14. JSF life cycle (part 1) What is JSF? No application data passed JSF Framework Restore Request view no data Render Response response What is JSF? 14
  • 15. JSF life cycle (part 2) What is JSF? Use of (HTML) form data JSF Framework Restore ... Request view no data Update Render ... model Response response values UI components organised in hierarchical tree per JSP bind input fields to business data in backing bean (managed bean) What is JSF? 15
  • 16. JSF life cycle (part 3) What is JSF? Navigation between pages (static vs. dynamic) JSF Framework Restore ... Request view no data Update Render Invoke model Response response application values rules in configuration file (faces-config.xml) <navigation-rule> <from-view-id>/index.jsp</from-view-id> <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/welcome.jsp</to-view-id> </navigation-case> What is JSF? 16
  • 17. JSF life cycle (part 4) What is JSF? Validation JSF Framework Apply Restore Process request Request view validations values no data validation error Update Render Invoke model Response response application values • syntax -> faces validators working on data in UI components • business -> logic accessing model values in managed beans Error messages via FacesMessage objects and special tags in JSP What is JSF? 17
  • 18. JSF life cycle (final) What is JSF? Event handling JSF Framework Apply request values Process validations Restore PVE Request view PVE AE immediate input no data immediate command convervion/ validation error Invoke application Render Update model AE Response response values PVE AE C V VCL(n) VCL(a) AL(n) AL(a) A • action events - when a command is pressed (button or link) • process validation events- when value of an input field has changed • input events - immediate commands - immediate input • (pre- and post) phase events What is JSF? 18
  • 19. JavaServer Faces (JSF) What is JSF? • Web frameworks • JSF terminology • JSF life cycle • Web development with JSF • Q&A What is JSF? 19
  • 20. Web development with JSF What is JSF? JSF application consists of: • JSP pages • UI components represented as stateful objects on the server • a custom tag library for rendering UI components • a custom tag library for representing event handlers and validators • JavaBeans (or model objects) containing application-specific func- tionality and data • event listeners • server-side helper classes • validators, event handlers, and navigation handlers • application configuration resource file faces-config.xml What is JSF? 20
  • 21. Web development with JSF What is JSF? Native Supported by IDE • IBM WebSphere Studio and Rational Developer • Sun Java Studio Creator • Borland JBuilder • Oracle JDeveloper • ... or Integration of JSF with EGL (see next presentation) What is JSF? 21
  • 22. JavaServer Faces (JSF) What is JSF? • Web frameworks • JSF terminology • JSF life cycle • Web development with JSF • Q&A What is JSF? 22
  • 23. JavaServer Faces (JSF) What is JSF? Thank you Gie Indesteege ABIS Training & Consulting What is JSF? 23