4.2. RichFaces Architecture Overview
Figure 4.2. Core AJAX component structure
To make the most of RichFaces, you should register a Filter
in your application's web.xml
. The Filter
recognizes multiple request types. The sequence diagram in Figure 5.3 shows the differences in processing between a regular JSF request and an AJAX request.
Figure 4.3. Request processing sequence diagram
ResourceBuilder
class.
Resource Cache
for this resource. If it is present, the resource is returned to the client. Otherwise, the filter searches for the resource among those registered in the ResourceBuilder
. If the resource is registered, the RichFaces filter requests that the ResourceBuilder
creates (delivers) the resource.
Figure 4.4. Resource request sequence diagram
AJAX Action components are used to send AJAX requests from the client side. There are a number of AJAX Action components, including <a4j:commandButton>
, <a4j:commandLink>
, <a4j:poll>
, and <a4j:support>
.
AjaxContainer
is an interface that defines an area on your JSF page that should be decoded during an AJAX request. AjaxViewRoot
and AjaxRegion
are both implementations of this interface.
The RichFaces JavaScript Engine runs on the client side, and updates different areas of your JSF page based on information from the AJAX response. This JavaScript code operates automatically, so there is no need to use it directly.