Java Reference
In-Depth Information
Iterate over the list and output the Catalog ids and Catalog journals:
for(Catalog catalog:catalogs){
out.println("<br/>"+"Catalog Id:");
out.println(catalog.getId()+"<br/>");
out.println("Catalog Journal:");
out.println(catalog.getJournal()+"<br/>");
Similarly, output all the entity instances of Edition , Section , and Article . Next,
delete some data with the deleteSomeData() method:
beanRemote.deleteSomeData();
Output all the Catalog , Edition , Section , and Article instances after deleting
some data. The EJB3Client.jsp is listed next:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="model.*,java.util.*,javax.naming.*"%>
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252" />
<title>EJB3Client</title>
</head>
<body>
<%
InitialContext context = new InitialContext();
CatalogSessionEJBRemote beanRemote = (CatalogSessionEJBRemote)
context.lookup("EJB3-SessionEJB#model.
CatalogSessionEJBRemote");
beanRemote.createTestData();
List<Catalog> catalogs = beanRemote.getAllCatalogs();
out.println("<br/>" + "List of Catalogs" + "<br/>");
for (Catalog catalog : catalogs) {
out.println("Catalog Id:");
out.println("<br/>" + catalog.getId() + "<br/>");
out.println("Catalog Journal:");
out.println(catalog.getJournal() + "<br/>");
}
out.println("<br/>" + "List of Editions" + "<br/>");
List<Edition> editions = beanRemote.getAllEditions();
for (Edition edition : editions) {
 
Search WWH ::




Custom Search