What is a managed bean in JSF?

What is a managed bean in JSF?

Ninja Asked on 19th September 2018 in JSF.
Add Comment
1 Answer(s)
Best answer

A managed bean is a lightweight container-managed object (POJO) that works as a model for UI component. A managed bean is created with a constructor with no arguments, a set of properties, and a set of methods that perform functions for a component. Managed beans typically perform the following function:

  • Validating a component’s data
  • Handling an event fired by a component
  • Performing processing to determine the next page to which the application must navigate

Managed beans are created using @ManagedBean annotation or using managed-bean tag in faces-config.xml. For example, a Student managed bean can be written as follows:

Ninja Answered on 19th September 2018.
Add Comment