Notes from Core JavaServer Faces - Chapter 01

Here they are.. Great book btw..

A JavaBean is a class that exposes properties by following a simple naming convention for the getter and setter methods.

A property is a named value of a given type that can be read and/or written.

A Managed Bean
• is a Java bean that can be accessed from a JSF page.
• must have a name and a scope.
• is managed in the following sense:
When the bean name occurs in a JSF page, the object is constructed if it does not exist yet in the appropriate scope and the object is exposed to the caller.

In JSF applications, Managed Beans are used for all data that needs to be accessible from a page.

Facelets,
• must be properly formatted XHTML (HTML that is also a proper XML).
• h:head, h:body and h:form must be used.
• Instead of familiar HTML tags, h:inputText, h:commandButton etc is used.


JSF Life Cycle

1. Restore View
• Constructs / retrieves the component tree for the requested page

2. Apply Request Values
• JSF iterates over the component objects in the component tree. Each component checks which request values belong to it and stores them. These values are called 'local values'. (encoding)

3. Process Validations
• Validators are executed in Process Validations phase.

4. Update Model Values
• Local values are used to update the beans that are wired to the components.

5. Invoke Application
• The "action" method of the button or link component that caused the form submission is executed. An "outcome" string is returned from this method.
Navigation handler decides on the next page to be rendered depending on the outcome.

6. Render Response
• Response is converted to HTML (decoded) and sent back to the browser.