Details about DataBeans


A data bean is a java bean that is used within a jsp page to provide dynamic contect to the jsp page. A data bean normally provides a simple representation of a WebSphere Commerce Entity bean.

There are 3 types of data beans:
  • Smart data bean: When a smart data bean is activated, the data bean manager invokes the data bean's populate method. Using the populate method, the data bean can retrieve all attributes, except attributes from associated objects.
  • Command data bean: A data bean implementing the CommandDataBean interface retrieves data from a data bean command. A data bean of this type is a lightweight object; it relies on a data bean command to populate its data. The data bean must implement the getCommandInterfaceName() method which returns the interface name of the data bean command.
  • Input data bean: A data bean implementing the InputDataBean interface retrieves data from the URL parameters or attributes set by the view.
Attributes defined in this interface can be used as primary key fields to fetch additional data. When a JSP page is invoked, the generated JSP servlet code populates all the attributes that match the URL parameters, and then activates the data bean by passing the data bean to the data bean manager. The data bean manager then invokes the data bean's setRequestProperties() method (as defined by the com.ibm.commerce.InputDataBean interface) to pass all the attributes set by the view.


Comments

Popular posts from this blog

Dataload Utility In WCS

10 Steps to Configure Email – Websphere Commerce Server

Multiple Wish List