Java Reference
In-Depth Information
We shall use the first method. Create a remote business interface instance using
lookup with the mapped name:
CatalogTestSessionEJB beanRemote = (CatalogTestSessionEJB) context.
Invoke the test() method of the session bean:
String catalog=beanRemote.test();
Output the string returned by the test method:
<%=catalog %>
The EJB3Client is listed next:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<%@ page import="model.*, javax.naming.*" %>
<%@ page
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" />
<body><% InitialContext context = new InitialContext();
CatalogTestSessionEJB beanRemote = (CatalogTestSessionEJB)
String catalog=beanRemote.test(); %><%=catalog %></body>
Testing the client
To run the test client, right-click on, EJB3Client.jsp and select Run .
Search WWH ::

Custom Search