• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Understanding Implementation of JavaServer Faces (JSF) Specification

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a book, "How Tomcat Works" which is a good resource if one wants to learn inner working of servlet container. The book shows how tomcat 4 is actually written in java.

Is there any kind of resource through which I can get similar understanding about JavaServer Faces? I already have basic understanding and some hands-on on JSF.

I tried going through mojarra JSF source code available on github and JSF specification but for me its too abstract. What I want is to have clear understanding about the implementation of the JSF life cycle and some of the UI components.

So I am looking for some material through which I can learn how the JSF specification is actually implemented through code.

Thanks,
Sushant
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Sushant!

In a nutshell, JSF works as a Movel/View/Controller framework, where the master Controller is the FacesServlet, the Views are defined as template files (.xhtml in JSF2), and the Models are user-designed POJOs. Every JSF request is routed into the FacesServlet, which determines which View it will render, thereby determining what Model(s) the View will require. Model objects that do not already exist are automatically manufactured under direction of the FacesServlet and placed into their specified context. There are finer points to the process, but that's the architectural framework.

The actual JSF logical lifecycle is well-documented. Point your web search tool of choice to "JSF Lifecycle" and you'll probably be rewarded with a number of pages that display the block diagram of the JSF lifecycle. It hasn't changed notably since JSF was first created.

The FacesServlet creates and maintains compiled versions of the View Templates as data structures called Component Trees. The Component Tree contains information about how to render the View and anchors input data. The net effect is that you can author complex web applications with validated forms by writing View Templates and POJO UI Model objects (backing beans), and the Controllers are already pre-supplied. In fact, excluding the DataModel and SelectItem objects, most well-designed JSF apps have almost no JSF-specific code in them. JSF works from the outside, using the Inversion of Control (IoC) design pattern.

Those are the high points. My reference for details has been Kito Mann's "JavaServer Faces in Action" (Manning Press), although my copy is quite old now.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic