Java Reference
In-Depth Information
<stateless-session-descriptor>
<business-interface-jndi-name-map>
<business-remote>CatalogTestSessionEJB
</business-remote>
<jndi-name>EJB3-SessionEJB</jndi-name>
</business-interface-jndi-name-map>
</stateless-session-descriptor>
</weblogic-enterprise-bean>
We will use the first method to create a remote business interface instance using
lookup with the mapped name.
CatalogSessionEJB catalogSessionEJB = (CatalogSessionEJB)
context.lookup("EJB3-JSF-EJB3Model-CatalogSessionEJB#model.
CatalogSessionEJB");
Retrieve the input text values using the getValue() method on the UI components
that have a binding with the JSF page components. For example, the journal input
text's value is retrieved as follows:
String journal = (String)it2.getValue();
Invoke the persistEntity() method of the session bean to persist an entity instance
created from the input text values:
catalogSessionEJB.persistEntity(id, journalField,
publisherField,editionField,
titleField,authorField);
The cb1_action method returns a String "persisted" that navigates back to the
index.jsp page.
The JSF page to find an Entity
The find.jsp JSF page is used to find a catalog entry for a catalog ID. The find.jsp
has a af:inputText component to specify a catalog ID. Add a Heading 1 and a Panel
Form Layout to find.jsp . To the Panel Form Layout , add an Input Text from the
ADF Faces' Component Palette . Add a Command Button below the Input Text field.
 
Search WWH ::




Custom Search