Saturday, 10 November 2012

JSF consists of 
Java classes
• “Faces” components: server-side equivalents of HTML
components (text,buttons,check boxes, etc.)
• FacesServlet (web.xml)
• Helper classes (converters, validations, etc) 
Tag libraries
• Sun Microsystems tag libraries
• Used in JSPs and Facelets 
Configuration file (faces-config.xml)
• JSF project configuration: navigation between pages,JavaBeans used by JSF



JSF Architecture

JSF is a web application framework that implements the MVC design pattern, and a clean separation of concerns:
Model: Contains UI data and handles database interactions 

View: Defines the user interface with a hierarchy of components using a declarative markup language(eg xhtml)

Controller: Handles user interactions and navigation between views



Managed Bean Scopes
• The JSF managed bean facility provides three scopes in which managed-
beans may exist:
request:
• Very short lifespan –created when the request begins, and
scheduled for garbage collection when the request completes
• For efficiency, try to place managed beans in request scope
session:
• The HttpSession can be used to store application state, such as
the contents of a shopping cart
• The lifespan of an HttpSession is determined by a timeout or by
invalidation (when a user logs out)
application:
• Lifespan continues as long as the web application is deployed
• Useful for sharing data between users

No comments:

Post a Comment