J4Fry JSF OnLoad Tag
Characteristics
Attribute | Value |
---|---|
Project name | J4Fry JSF OnLoad [Subproject of J4Fry JSFComponents] |
Prerequisites | JDK >= 1.4, JSF >= 1.1 |
Started with revision | 1.1_06 |
CVS module | JSFComponents |
Responsible developer | Ganesh Jung |
OnLoad Tag aims
Some applications have a start page that doesn't need any initialization. Maybe there is a static menu to welcome the user and any accesses to the backend or to the persistence layer are preceded by a menu click that induces a JSF action that does the neccessary calls. If you've this kind of application you're not the target user of this tag.
Some other applications have got a starting page that requires some preliminary action before the view can be displayed. JSF gets a non-faces request (a HTTP GET), skips the first phases and start off by rendering the response. JSF doesn't provide a hook for your page to initialize itself. It will call the getters of your backing beans and expect them to have their data at hand.
To enable action calls during the rendering phase we provide the onLoad tag. Define the action that should be triggered while rendering the page and define if it is called with HTTP GET or with HTTP POST.
Usage
Refer to the general JSF Components installation for installation instructions.
Add
<fry:onLoad action="#{myBean.myActionMethod}" />
to your page. The action will be triggered during the render reponse phase when the JSF servlet calls encode methods of
the onLoad component. Add attribute
onGET="false" (default: true)
to disable action invocation for non-faces requests (HTTP GET) and
onPOST="false" (default: true)
to disable action invocation for faces requests (HTTP POST).
Also refer to:
J4Fry Taglib description
for further reference.