Java Reference
In-Depth Information
<td>Builder:</td>
<td><INPUT TYPE=TEXT NAME=Builder></td></tr>
<tr><td>Engine Type:</td>
<td><INPUT TYPE=TEXT NAME=EngineType></td>
<td>Capacity:</td>
<td><INPUT TYPE=TEXT NAME=Capacity></td></tr>
<tr><td>Maximum Velocity:</td>
<td><INPUT TYPE=TEXT NAME=MaxVelocity></td>
<td></td>
<td>><INPUT TYPE=SUBMIT NAME="CreateNewYacht"
VALUE=Create></td></tr>
</table>
<b>Search Yachts Big Enough:</b><br>
<table>
<tr><td>Find yachts with capacity more than: </td>
<td><INPUT TYPE=TEXT NAME=MinCapacity></td>
<td><INPUT TYPE=SUBMIT Value="Find"></td></tr>
</table>
</FORM>
<%!
private static Context ctx;
static {
try {
ctx = new InitialContext();
} catch (Exception e) {
System.out.println("Error trying to do one time
initialization.\n" + e);
}
}
public void log(String logMsg, JspWriter out) throws Exception {
out.print(logMsg + "<BR>");
}
%>
</body>
</html>
This JSP client allow you to add a new yacht to the yacht club's possession, to remove a yacht, and to
search for yachts that have a capacity over a give number. The name and capacity of the yacht that
meet the searching criteria are listed at the top of the browser screen. By clicking the hyperlink marked
"Destroy," the corresponding yacht is removed from the database. When adding a new yacht, you need
to provide the five persistent attributes of the yacht, namely, yacht name, its builder, the engine type,
capacity, and maximum velocity. An output screen for running this JSP client is illustrated in Figure 22-1 .
Search WWH ::




Custom Search