Using the generic backing bean

About this task

If you prefer to use the generic backing bean rather than develop a new backing bean, take the following steps:
  1. Declaring New PropertyResolver.
  2. Creating a new backing bean which extends the base bean delivered by BTT as the generic backing bean.
  3. Declaring the Managed Beans.

    When you declare a new managed bean, you can assign the <managed-bean-class> element with the generic backing bean class. See the following example:

    		<managed-bean>
        		<managed-bean-name>accountSummaryBean</managed-bean-name>
        		<managed-bean-class>test.ExtendingBaseBean</managed-bean-class>
        		<managed-bean-scope>request</managed-bean-scope>
        		<managed-property>
          			<property-name>beanContextName</property-name>
          			<value>accountSummaryCtx</value>
        		</managed-property>
    		</managed-bean>
    	
    		<managed-bean>
        		<managed-bean-name>accountTransferBean</managed-bean-name>
        		<managed-bean-class>test.ExtendingBaseBean</managed-bean-class>
        		<managed-bean-scope>request</managed-bean-scope>
        		<managed-property>
          			<property-name>beanContextName</property-name>
          			<value>accountTransferCtx</value>
        		</managed-property>
    		</managed-bean>
  4. Writing JSP Pages
    When you write the method binding expressions in your JSP pages, follow the three rules:
    1. The UI component ID must follow the format: <Invoker Id>_<Operation Name>
    2. Add actionListener attribute to the UI component, the value is <managed bean name>.execute
    3. The action attribute value of the UI component is <managed bean name>.outcome.

    Following is an example:

    <h:commandButton id="htmlAdaptorInvoker_accountTransferOp"
     			actionListener="#{accountTransferBean.execute}" 	
    			action="#{accountTransferBean.outcome}" value="Transfer"/>