first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

JavaServer Faces in Action Notes: Chapter 2; JSF Fundamentals; 2.1.2 Renderers; 2.1.3 Validators

2.1.2 Renderers

"When components render themselves, it's called the direct implementation model, but JSF also supports the delegated implementation model..." The classes that implement these implementation models are called "renderers." All of the standard JSF components use the delegated implementation model.

"Renderers are organized into render kits... JSF ships with a standard render kit for HTML 4.01..."

It is important to understand that renderers implement encoding and decoding for the response and the request, respectively. "Because all encoding and encoding is handled by a single entity... the visual representation of the component and the underlying protocol for translating between request parameters and objects on the server are nicely self-contained."

It follows that the ability to change a render kit means that "displaying a different markup language is just a matter of changing the render kit."

2.1.3 Validators

"Faces handles validation in three ways---at the UI component level [declaratively], via validator methods in backing beans, or in validator classes."

Here is an example of declarative validation:

<h:inputText>
    <f:validateLength minimum="2" maximum="10" />
</h:inputText>
mod date: 2007-03-13T20:00:21.000Z