What are Backing Beans?

A Backing Bean, also called as a Pagebean is used to assist validation / event handling of a form.

simply put when a bean is created to contain all the form fields so that validators and event handlers may have access to the actual components of a form.


example

 
public class SamppleBean {
   private UIOutput output;
   private UIInput input;
   // PROPERTY
   public UIOutput getOutput() { return output; }
   public void setOutput(UIOutput newValue) { this.output = newValue; }
   // PROPERTY
   public UIInput getInput() { return input; }
   public void setInput(UIInput newValue) { this.input = newValue; }
   ...
}
 

for a form containing a input field input and an output field output.





About this entry