JSF - (Managed Bean|Controller)

Java Conceptuel Diagram

About

Managed Beans (also known as model objects and controllers) are lightweight container-managed objects (POJOs) with minimal requirements.

They support a small set of basic services, such as:

Jdeveloper Create Managed Bean

Components in a page are associated with managed beans that provide application logic. 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.

Each of the managed bean properties can be bound to one of the following:

The most common functions that managed bean methods perform include the following:

  • 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

Registration

Annotation

  • The @ManagedBean annotation registers the managed bean as a resource with the JavaServer Faces implementation. If no name is specified, the managed beans is always accessed with the first letter of the class name in lowercase.
  • The @SessionScoped annotation registers the bean scope as session.

Configuration File

JSF - faces-config.xml

Scope

  • Request
  • Session
  • Application
  • View
  • None

Property

In a managed bean, a property consists of:

package hello;

import javax.faces.bean.ManagedBean;

@ManagedBean
public class Hello {

    final String world = "Hello World!";

    public String getworld() {
        return world;
    }
}

When bound to a component’s value, a bean property can be any of the basic primitive and numeric types or any Java object type for which the application has access to an appropriate converter. For example, a property can be of type Date if the application has access to a converter that can convert the Date type to a String and back again.

Documentation / Reference





Discover More
Card Puncher Data Processing
Eclipse - Oracle Enterprise Pack for Eclipse (OEPE)

Oracle Enterprise Pack for Eclipse (OEPE) provides development support for: ADF Faces and ADF Controller. Oracle Enterprise Pack for Eclipse (OEPE) 12.1.1.0 for Eclipse Indigo provides tools that...
Jdeveloper Create Managed Bean
JSF - (Managed Bean|Controller)

Managed Beans (also known as model objects and controllers) are lightweight container-managed objects (POJOs) with minimal requirements. They support a small set of basic services, such as: resource...
Java Conceptuel Diagram
JSF - Facelet

The term Facelets refers to the view declaration language for JavaServer Faces technology. Facelets is a page declaration language that is used to build JavaServer Faces views using HTML style templates...
Java Conceptuel Diagram
JSF - How to create a simple (JSF Data Table|ADF Table)

How to create a data table with Eclipse OEPE ? The managed bean with a variable of the type enumerable. Note that Enumerable types include type java.util.Collection, java.util.Iterator,...
Java Conceptuel Diagram
JSF - Listener

Listeners are used to listen to the events happening in the page and perform actions as defined. An application developer can implement listeners as: classes or as managed bean methods. If...
Java Conceptuel Diagram
JSF - Validators

Validators are used to validate the data that is received from the input components. JavaServer Faces technology provides a set of standard classes and associated tags that page authors and application...
Jdeveloper Faces Config Xml
JSF - faces-config.xml

Configuration file of JSF. Permits to manager the declaration and configuration of: Managed bean Navigation Rules Validators Converters ...
Java Conceptuel Diagram
Java - Controller

A JPA controller class (DAO) is a wrapper for an entity class that provides clients with access to the database through the methods in the entity class. The JPA controller class contains the logic for...
Java Conceptuel Diagram
Java - Expression Language (EL)

The Expression Language (also referred to as the EL) provides an important mechanism for enabling the presentation layer (web pages) to communicate with the application logic (managed beans). The EL...
Java Conceptuel Diagram
Java - Server Side Components

Server-side components enable application developers to develop “business logic” and package it as a component that can be assembled into applications. JSF server-side objects: managed beans,...



Share this page:
Follow us:
Task Runner