Js F Overview 80
Js F Overview 80
JSF applications in
Rational Application Developer Version 8.0
September 2010
The JSF framework unifies techniques for simplifying Web application design
and development by addressing the following Web application design and
development concerns:
Navigation
JSF introduces a layer of separation between business logic and the
resulting UI pages; stand-alone flexible rules drive the flow of pages.
Internationalization
JSF provides tools for internationalizing Web applications, supporting
number, currency, time, and date formatting, and externalizing of UI
strings.
In JSF 2.0, Facelets 2.0 is the standard view decoration language for JSF
application development. It is not recommended to combine Faces JSP and
Facelets in the same project.
The JSF tools in Rational Application Developer fully supports JSF 2.0 and
Facelet development. You can create Facelet pages and templates, drag and
drop Facelet UI components from the palette to your page, and edit the
component attributes in the Properties view.
Process validations
As part of the creation of the view for this request, zero or more validator
instances can be registered for each component. In addition, component classes
themselves can implement validation logic in their validate() methods. At the end
of this phase, all configured validations are completed.
Invoke application
As described when building a restore view, if the view for the current request was
reconstructed from state information saved by a previous request, the
JavaServer Faces implementation will have ensured that the ActionListener
returned by calling getActionListener on the Application object for this Web
application will be registered with all UICommand components in the component
tree, by virtue of the restoreState() method.
Render response
This phase accomplishes two things at the same time: causes the response to
be rendered to the client, and causes the state of the response to be saved for
processing on subsequent requests. The reason for handling both of these
responsibilities in one phase is because the act of rendering the response in JSP
applications can cause the view to be built as the page renders. Therefore, the
state of the view cannot be saved until after it is rendered to the client.
Event Processing
During several phases of the request processing life cycle, events can be
queued, for example, via a call to the queueEvent() method on the source
UIComponent instance, or a call to the queue() method on the FacesEvent
instance. These queued events must now be broadcast to interested event
listeners. The broadcast is performed as a side effect of calling the appropriate
life-cycle management method (processDecodes(), processValidators(),
It is also possible for event listeners to cause additional events to be queued for
processing during the current phase of the request processing life cycle. Such
events must be broadcast in the order they were queued after all originally
queued events are broadcast, but before the life-cycle management method
returns.
Model-view-controller architecture
The JSF framework implements the Model-View-Controller (MVC) architecture
ensuring that applications are well designed and easier to maintain..
Application developer
Component developer
These users create reusable JSF components, such as UI components,
renderers, and validators. They are responsible for encoding the data from the
application developer's interfaces, as well as decoding the request information to
update the model. They require skills in J2EE and JSF APIs. The JSF Widget
Library (JWL), created by IBM and included in this product, does the work of the
component developer by providing reusable JSF components.
A page developer creates a new JSF-enabled Web application and imports the
supplied JAR file from the application developer. The page developer creates a
new JSF page for interfacing with the database and adds a class from the JAR
to the page as a managed bean, then drags it onto the page. A set of fields are
created with which to update the record. The page developers drags a command
button onto the page from the Enhanced Faces drawer of the palette and
associated it wit a supplied update method in the supplied business logic. The
page developer adds navigation rules to display other pages based on the
success of the update operation. Finally, the page is tested by running it on the
application server.
The end user accesses the Web application for the database application to
update the database directly via a Web interface.
Validation
You can validate your Web application to ensure that the syntax is correct and
your markup is well-formed. A validator is a tool that checks that resources
conform to a specification or set of rules. You can add and remove validators
from your Web application. To configure what validators will run on a project,
click Window > Preferences > Validation. The JSF validators include:
Content assist
Content assist provides context-based proposals at the current text insertion
point. A popup of possible tags and attributes are made available as you type.
Content assist is available for most of the JSF tag library attribute values.
In addition to the JSF Trace view, the JSF Trace console presents raw
information received over the network socket from the running application.