Java Reference
In-Depth Information
Collection coll = null;
if (request.getParameter("MinCapacity") != null) {
int minCapacity = 0;
try {
minCapacity = Integer.parseInt(request.getParameter("MinCapacity"));
} catch (Exception e) {
minCapacity = 10;
}
coll = home.findYachtsCapacityMoreThan(minCapacity);
} else {
coll = home.findAllYachts();
}
%>
<html><head><title>Manage Yacht</title></head><body>
<b>Yachts</b><br>
<%
Iterator iter = coll.iterator();
%>
<table width="400" border="thin" cellpadding="0" cellspacing="0">
<%
while (iter.hasNext()) {
Yacht yacht = (Yacht)iter.next();
%>
<tr><td width="25%"><%= (String)yacht.getPrimaryKey() %></td>
<td width="25%"><%= yacht.getCapacity() %></td>
<td width="25%"><a href=YachtSessionManager.jsp?YachtPK=<%=
(String)yacht.getPrimaryKey() %>&Action=View>View
Session</a></td>
<td width="25%"><a href=YachtManager.jsp?DestroyYacht=<%=
(String)yacht.getPrimaryKey() %>>Destroy</a></td></tr>
<%
}
%>
</table>
<%
}
%>
<FORM action=YachtManager.jsp>
<b>Create a New Yacht:</b><BR>
<table>
<tr><td>Yacht Name:</td>
<td><INPUT TYPE=TEXT NAME=YachtName></td>
Search WWH ::




Custom Search