Managed Bean:
1) Represents a Java class which will be created dynamically during runtime of the JSF application. It can be defined for which scope the bean is valid (Session, Request, Application or none).
2) Simple java object which are declared in "faces-config.xml".
3) In JSF you can access the values of a managed bean via value binding.
Backing Bean: A backing bean defines UI component properties, each of which is bound to either a component's value or a component instance. A backing bean can also define methods that perform functions associated with a component, including validation, event handling, and navigation processing.
If you are configuring a backing bean that is referenced by a component tag's
Binding a component instance to a bean property has these advantages:
1) The backing bean can programmatically modify component attributes.
2) The backing bean can instantiate components rather than let the page author do so.
For Ex: <inputText binding="#{UserNumberBean.userNoComponent}" />
Binding a component's value to a bean property has these advantages:
1) The page author has more control over the component attributes.
2) The backing bean has no dependencies on the JavaServer Faces API (such as the UI component classes), allowing for greater separation of the presentation layer from the model layer.
3) The JavaServer Faces implementation can perform conversions on the data based on the type of the bean property without the developer needing to apply a converter.
For Ex: <h:inputText id="userNo" value="#{UserNumberBean.userNumber}"
validator="#{UserNumberBean.validate}" />
1) Represents a Java class which will be created dynamically during runtime of the JSF application. It can be defined for which scope the bean is valid (Session, Request, Application or none).
2) Simple java object which are declared in "faces-config.xml".
3) In JSF you can access the values of a managed bean via value binding.
Backing Bean: A backing bean defines UI component properties, each of which is bound to either a component's value or a component instance. A backing bean can also define methods that perform functions associated with a component, including validation, event handling, and navigation processing.
If you are configuring a backing bean that is referenced by a component tag's
binding
attribute, you should define the bean with a request scope. If you placed the bean in session or application scope instead, the bean would need to take precautions to ensure thread safety because UIComponent
instances depend on running inside of a single thread.Binding a component instance to a bean property has these advantages:
1) The backing bean can programmatically modify component attributes.
2) The backing bean can instantiate components rather than let the page author do so.
For Ex: <inputText binding="#{UserNumberBean.userNoComponent}" />
Binding a component's value to a bean property has these advantages:
1) The page author has more control over the component attributes.
2) The backing bean has no dependencies on the JavaServer Faces API (such as the UI component classes), allowing for greater separation of the presentation layer from the model layer.
3) The JavaServer Faces implementation can perform conversions on the data based on the type of the bean property without the developer needing to apply a converter.
For Ex: <h:inputText id="userNo" value="#{UserNumberBean.userNumber}"
validator="#{UserNumberBean.validate}" />