In this article we’ll discuss about the JSF Binding. The different types of event handling ,validation and widget library are explained.

JSF – Event Handling

JSF makes it easy to designate Java code that is invoked when forms are submitted. The code can respond to particular buttons, changes in particular values, certain user selections, and so on.

Method Bindings

<h:outputText value=“#{bundle.welcome}” rendered=“#{bean.showWelcome}”/>

Value Change Listeners

<h:selectOneMenu value=“#{bean.type}” onchange=“submit()” 
immediate=“true” valueChangeListener=“#{bean.change}”>
<f:selectItems value=“#{bean.types}”>

Command Actions

<h:commandButton action=“#{bean.submit}”/>

Action Listeners

<h:commandButton actionListener=“#{bean.listen}” action=“#{bean.submit}”/>

JSF – Input Validation

Standard Validators

<h:inputText id=“card” value=“#{bean.card}” required=“true”>
<f:validateLength minimum=“13”/>
Custom Validators
Validation Errors
<h:message for=“card”/>


JSF – Define Configuration Files

Faces-Config-bean.xml (For defining all Managed Beans)


Faces-Config-Nav.xml (For Navigational Rule)


JSF – FacesConfig.xml Snapshot

<!-- variable/property resolver registration -->


JSF – JWL (JSF Widget Library )

JWL (The JSF Widget Library) consists of a large number of complex components. These enable you to speedily build rich and reliable Web applications. The Tree Control is a prime example of such a component. The JWL components are currently shipping with IBM Web sphere Studio Application Developer 5.1.2 (WSAD), IBM Rational Application Developer 6.0 (IRAD) and beyond. The tooling provided by IRAD allows you to simply and quickly develop complex Web applications using these components.

Required Jar files are odc-jsf.jar, jsf-impl.jar
JSF – JWL Tree Component

  • Tree component provides a hierarchical structure to store data on the browser.
  • It supports client-side data storage. This means faster access to data, quicker page refreshes and less roundtrips to the server.
  • User-friendly and extremely powerful Web component
  • The JWL component also has a number of custom event handlers at both a tree and node level.