SlideShare uma empresa Scribd logo
1 de 32
Introduction toJSF
Objective Understand the basic concepts of Java Server Faces (JSF) Technology.
Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
JSF (JavaServer Faces) Framework Is… A server side user interface component framework for Java technology-based web applications F-35 JSF  Joint Strike Fighter
Ok, but what JSF really is? A specification and reference implementation for a web application development framework Components Events Validators & converters Navigation Back-end-data integration Localization Error Handling
But why JSF? Standard Huge vendor and industry support MVC for web applications Clean separation of roles Easy to use Extendable Component and Rendering architecture Support for client device independence
Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
JSF Architecture Server Desktop Browser HTML Renderer kit HTML App Backend Front Ctrl JSF Page JSF Page Phone WML Renderer kit WML
Request Processing Lifecycle Phases Restore component tree phase Apply request values phase Process validations phase Update model values phase Invoke application phase Render response phase
Request Processing Lifecycle Phases ,[object Object]
Component values are convertedComponent tree retrieved Restore View Request Component values validated Component values bound to backing bean Apply Request Values Process Validations ,[object Object]
Methods invoked
Navigation calculatedUpdate Model Values Invoke Application Render Response Response Component values are updated from backing bean properties System-level phase Application-level phase
Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
User Interface Component Model UI components Event handling model Conversion and Validation model Rendering model Page navigation support
UI Components UIComponent/UIComponentBase Base class for all user interface components Standard UIComponent Subclasses UICommand, UIForm, UIOutput UIGraphic, UIInput, UIPanel, UIParameter UISelectBoolean, UISelectMany, UISelectOne Example ,[object Object],[object Object]
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException;Example ,[object Object],[object Object]
Easy to create custom convertersImplement interface and  ,[object Object]
Input: String to ObjectExample ,[object Object],[object Object]
EncodingRenderKits—Library of Renderers ,[object Object]
Is a custom tag library
Basic HTML RenderKit,[object Object]
ValueChangedEvent—UIInput component whose value was just changedSystem events ,[object Object]
Global and component system events - UIComponent.subscribeToEvent() or <f:event> tag.,[object Object]
Or implicitly (since JSF 2.0)Navigation rules ,[object Object]
Navigation case,[object Object]
Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
What’s new? FaceletsView Declaration Language Annotation based configuration Standardized Ajax Implicit Navigation Scopes (conversation, view, flash, custom) Composite Components Bean Validation Support Error Handling more - resource loading, improved GET support, behaviors, tree visiting, system events and many more (out of scope)
Facelets, Annotations, Scopes Facelets are used by default instead of JSP. Annotation based configuration ,[object Object],New scopes ,[object Object]
Conversation and Flash.
Custom,[object Object]
f:ajax tagExamples <h:selectOneMenuvalue="#{dynamicProperties.targetClass}"> <f:ajaxevent="change"execute="@form"render="@form"/> <f:selectItemsvalue="#{dynamicProperties.targetClasses}"/> </h:selectOneMenu> <h:commandButtonvalue="Count" onclick="jsf.ajax.request(this.id, event, {execute: this.id, render: 'out1'}); return false;"/>

Mais conteúdo relacionado

Mais procurados

Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
guest764934
 
Sun JSF Presentation
Sun JSF PresentationSun JSF Presentation
Sun JSF Presentation
Gaurav Dighe
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
Tuna Tore
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
Guo Albert
 

Mais procurados (20)

Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
 
Jsf2.0 -4
Jsf2.0 -4Jsf2.0 -4
Jsf2.0 -4
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
 
Jsf Framework
Jsf FrameworkJsf Framework
Jsf Framework
 
Sun JSF Presentation
Sun JSF PresentationSun JSF Presentation
Sun JSF Presentation
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
9. java server faces
9. java server faces9. java server faces
9. java server faces
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5
 
TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6
 
Securing JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top TenSecuring JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top Ten
 
Spring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topicsSpring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topics
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Struts course material
Struts course materialStruts course material
Struts course material
 
Oracle ADF Case Study
Oracle ADF Case StudyOracle ADF Case Study
Oracle ADF Case Study
 
Spring MVC 3.0 Framework
Spring MVC 3.0 FrameworkSpring MVC 3.0 Framework
Spring MVC 3.0 Framework
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 

Destaque

Ejb 2.0
Ejb 2.0Ejb 2.0
Ejb 2.0
sukace
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overview
abhi1112
 
Enterprise modernization: improving the economics of mainframe and multi-plat...
Enterprise modernization: improving the economics of mainframe and multi-plat...Enterprise modernization: improving the economics of mainframe and multi-plat...
Enterprise modernization: improving the economics of mainframe and multi-plat...
IBM Rational software
 

Destaque (13)

EJB 3.0 and J2EE
EJB 3.0 and J2EEEJB 3.0 and J2EE
EJB 3.0 and J2EE
 
Maven (EN ESPANOL)
Maven (EN ESPANOL)Maven (EN ESPANOL)
Maven (EN ESPANOL)
 
Java desde cero maven
Java desde cero mavenJava desde cero maven
Java desde cero maven
 
Curso Arquitectura J2 Ee Parte1
Curso Arquitectura J2 Ee Parte1Curso Arquitectura J2 Ee Parte1
Curso Arquitectura J2 Ee Parte1
 
Et pourquoi pas JEE ?
Et pourquoi pas JEE ?Et pourquoi pas JEE ?
Et pourquoi pas JEE ?
 
Ejb 2.0
Ejb 2.0Ejb 2.0
Ejb 2.0
 
Mainframe - OPC
Mainframe -  OPCMainframe -  OPC
Mainframe - OPC
 
Mainframe Application Modernization for Enterprise Developers
Mainframe Application Modernization for Enterprise DevelopersMainframe Application Modernization for Enterprise Developers
Mainframe Application Modernization for Enterprise Developers
 
Basics of IBM Tivoli Storage Manager
Basics of IBM Tivoli Storage ManagerBasics of IBM Tivoli Storage Manager
Basics of IBM Tivoli Storage Manager
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overview
 
Mainframe
MainframeMainframe
Mainframe
 
Enterprise modernization: improving the economics of mainframe and multi-plat...
Enterprise modernization: improving the economics of mainframe and multi-plat...Enterprise modernization: improving the economics of mainframe and multi-plat...
Enterprise modernization: improving the economics of mainframe and multi-plat...
 
Mainframe modernization powered by AI
Mainframe modernization powered by AIMainframe modernization powered by AI
Mainframe modernization powered by AI
 

Semelhante a Introduction to JSF

Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 
Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Devoxx 09 (Belgium)
Devoxx 09 (Belgium)
Roger Kitain
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
Roger Kitain
 
Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play framework
Victor Porof
 

Semelhante a Introduction to JSF (20)

Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
Jsfsunum
JsfsunumJsfsunum
Jsfsunum
 
Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Devoxx 09 (Belgium)
Devoxx 09 (Belgium)
 
Jsp
JspJsp
Jsp
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
 
jBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersjBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developers
 
What's new and exciting with JSF 2.0
What's new and exciting with JSF 2.0What's new and exciting with JSF 2.0
What's new and exciting with JSF 2.0
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
 
Jsp 01
Jsp 01Jsp 01
Jsp 01
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Facelets
FaceletsFacelets
Facelets
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
Facelets
FaceletsFacelets
Facelets
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play framework
 

Mais de SoftServe

Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...
SoftServe
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe
 
Mobile augmented reality
Mobile augmented realityMobile augmented reality
Mobile augmented reality
SoftServe
 
SoftServe - the difference is you! join professionals!
SoftServe - the difference is you! join professionals!SoftServe - the difference is you! join professionals!
SoftServe - the difference is you! join professionals!
SoftServe
 

Mais de SoftServe (18)

Go Mobile! Windows Phone 7 for all
Go Mobile! Windows Phone 7 for all Go Mobile! Windows Phone 7 for all
Go Mobile! Windows Phone 7 for all
 
Agile frameworks
Agile frameworksAgile frameworks
Agile frameworks
 
Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...
 
There is time for rest
There is time for rest There is time for rest
There is time for rest
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
AGILE? YES!
AGILE? YES!AGILE? YES!
AGILE? YES!
 
Engineering practices within scrum
Engineering practices within scrumEngineering practices within scrum
Engineering practices within scrum
 
Distributed scrum keys to success
Distributed scrum keys to successDistributed scrum keys to success
Distributed scrum keys to success
 
Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication Foundation
 
Mono project
Mono project Mono project
Mono project
 
Social networks plus software developers
Social networks plus software developersSocial networks plus software developers
Social networks plus software developers
 
Project Management . The Change Agent
Project Management . The Change AgentProject Management . The Change Agent
Project Management . The Change Agent
 
Project Management . The Change Agent Vijay Prasad M.Tech, PMP
Project Management . The Change Agent Vijay Prasad M.Tech, PMPProject Management . The Change Agent Vijay Prasad M.Tech, PMP
Project Management . The Change Agent Vijay Prasad M.Tech, PMP
 
Project Management -Strategic Competency, & Trends
Project Management -Strategic Competency, & TrendsProject Management -Strategic Competency, & Trends
Project Management -Strategic Competency, & Trends
 
Mobile augmented reality
Mobile augmented realityMobile augmented reality
Mobile augmented reality
 
SoftServe - the difference is you! join professionals!
SoftServe - the difference is you! join professionals!SoftServe - the difference is you! join professionals!
SoftServe - the difference is you! join professionals!
 
Object oriented reality
Object oriented realityObject oriented reality
Object oriented reality
 
Pmo, project objectives and project life cycles
Pmo, project objectives and project life cyclesPmo, project objectives and project life cycles
Pmo, project objectives and project life cycles
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[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
 

Introduction to JSF

  • 2. Objective Understand the basic concepts of Java Server Faces (JSF) Technology.
  • 3. Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
  • 4. JSF (JavaServer Faces) Framework Is… A server side user interface component framework for Java technology-based web applications F-35 JSF Joint Strike Fighter
  • 5. Ok, but what JSF really is? A specification and reference implementation for a web application development framework Components Events Validators & converters Navigation Back-end-data integration Localization Error Handling
  • 6. But why JSF? Standard Huge vendor and industry support MVC for web applications Clean separation of roles Easy to use Extendable Component and Rendering architecture Support for client device independence
  • 7. Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
  • 8. JSF Architecture Server Desktop Browser HTML Renderer kit HTML App Backend Front Ctrl JSF Page JSF Page Phone WML Renderer kit WML
  • 9. Request Processing Lifecycle Phases Restore component tree phase Apply request values phase Process validations phase Update model values phase Invoke application phase Render response phase
  • 10.
  • 11.
  • 13. Navigation calculatedUpdate Model Values Invoke Application Render Response Response Component values are updated from backing bean properties System-level phase Application-level phase
  • 14. Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
  • 15. User Interface Component Model UI components Event handling model Conversion and Validation model Rendering model Page navigation support
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Is a custom tag library
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Agenda What is JSF and why JSF? Architecture Overview UI Component Model Summary of new features in JSF 2 Development Steps
  • 28. What’s new? FaceletsView Declaration Language Annotation based configuration Standardized Ajax Implicit Navigation Scopes (conversation, view, flash, custom) Composite Components Bean Validation Support Error Handling more - resource loading, improved GET support, behaviors, tree visiting, system events and many more (out of scope)
  • 29.
  • 31.
  • 32. f:ajax tagExamples <h:selectOneMenuvalue="#{dynamicProperties.targetClass}"> <f:ajaxevent="change"execute="@form"render="@form"/> <f:selectItemsvalue="#{dynamicProperties.targetClasses}"/> </h:selectOneMenu> <h:commandButtonvalue="Count" onclick="jsf.ajax.request(this.id, event, {execute: this.id, render: 'out1'}); return false;"/>
  • 33. Composite Components Define <html xmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite"> <h:head></h:head> <h:body> <composite:interface> <composite:attributename="who"/> </composite:interface> <composite:implementation> <h:outputTextvalue="Hello, #{cc.attrs.who}!"/> </composite:implementation> </h:body></html> Use <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"xmlns:greet="http://java.sun.com/jsf/composite/greet"> <greet:hellowho="World"/> </html>
  • 34.
  • 35. Steps in Development Process Develop model objects which hold the data Register model objects (managed bean) in faces-config.xml or use annotations Create Pages using UI component and core tags Define Page Navigation in faces-config.xml or use implicit navigation Configure web.xml
  • 36.
  • 37. Step 3: Create JSF Page
  • 38. Binding UI to Managed Bean editUser.xhtml <h:inputTextvalue="#{userEditBean.firstName}" required="true"/> EditUserBean.java @ManagedBean(name = "userEditBean") @SessionScoped publicclassEditUserBean { public String getFirstName() { … } public void setFirstName(String firstName) { … }
  • 39. Step 4: Define Page Navigation Rules <h:commandButtonaction="goBack" image="../images/back-arrow-small.png"/> <h:commandButtonvalue="LookupPrices"action="#{multiCategorySelectBackingBean.lookupPrices}"/> Web Page Backing Bean public String lookupPrices() { ... return "showPriceRecs"; } <navigation-rule> <from-view-id>/wizard/item.jsp</from-view-id> <navigation-case> <from-outcome>showPriceRecs </from-outcome> <to-view-id>/wizard/pricesResult.jsp</to-view-id> </navigation-case> <navigation-case> <from-outcome>goBack</from-outcome> <to-view-id>/wizard/start.jsp</to-view-id> </navigation-case> </navigation-rule> faces-config.xml
  • 40. Step 5: Configure (web.xml) Add <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>FacesServlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> May be not necessary with Servlets 3.0 compliant container