The different ways of declaring a managed bean in JSF:
1. Use @ManagedBean annotation in the java class indicating that the class is a managed bean as:
@ManagedBean(name="Greetings", eager="true")
2. If the name attribute is not specified the name is defaulted to the class name as java naming standards.
For example class Car will be named “car” and CarDetails will be named “carDetails”.
Declare the managed bean in faces-config.xml file as:
<managed-bean>
<managed-bean-name>Greetings</managed-bean-name>
<managed-bean-class>com.Greetings.Greetings</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>