JSF architecture

The architecture of JSF is based on the MVC2 model, which can be represented as Model, View, and Controller layers. This is shown in the following diagram:

Let's look at each of these blocks in detail:

  • Controller: The controller layer is represented by the  FacesServlet of the JSF framework. It is responsible for dispatching the request and the page navigation. It creates a FacesContext object that contains information required for request processing. FacesServlet also initiates the JSF Lifecycle object by invoking it and passing the FacesContext object to it. The JSF Lifecycle object handles the JSF request processing life cycle.
  • View: The view layer renders the pages using JSF technology, typically Facelets XHTML. This layer defines the content that is to be presented to the end user and includes page layout and other navigational components.
  • Model: The model is represented by managed beans. JSF-managed beans are normal POJOs that conform to the JavaBeans naming conventions and are mapped to JSF pages in the view layer. JSF-managed beans have to be registered in the configuration file either using annotations in the bean class, or in the faces-config.xml file. The beans will have defined scopes, such as the request scope, the session, the application, or the flow.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset