Java Reference
In-Depth Information
Note the use of the <%=SearchFormBean.getId()%> tag to supply the member id to the JSP page.
Using an Updatable ResultSet with an XSL Stylesheet
In addition to using the ResultSet for display purposes, it is very useful to be able to update the
database using the ResultSet itself. Updatable ResultSet s offer just this capability, in that they can
be updated directly. In other words, you can make updates to the values in the ResultSet itself, and
these changes are reflected in the database.
The XML-based and XSLT-based approach to creating a Web page lends itself well to use with
updatable ResultSets . One of the advantages of XS L is that you can create a completely different
Web page from the same XML by simply applying a different stylesheet. To illustrate this capability, try
applying the stylesheet shown in Listing 15-12 to the original XML of Listing 15-9 .
Listing 15-12: Creating a different Web page from the same XML
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="VehicleData">
<HTML>
<HEAD>
<TITLE>
Edit Detail Page
</TITLE>
</HEAD>
<BASEFONT FACE="Arial"/>
<BODY>
<FORM method="post" action="ProcessVehicleUpdateForm.jsp">
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TD>Color</TD>
<TD>
<INPUT type="text" name="color">
<xsl:attribute name="value">
<xsl:value-of select="Color"/>
</xsl:attribute>
</INPUT>
</TD>
</TR>
<TR>
<TD>Year</TD>
<TD>
Search WWH ::




Custom Search