morgand 01/02/01 16:09:19
Modified: jdbc/doc/web index.html
Log:
added documentation for wasNotNull tag
Revision Changes Path
1.3 +76 -29 jakarta-taglibs/jdbc/doc/web/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jdbc/doc/web/index.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- index.html 2001/01/31 00:43:49 1.2
+++ index.html 2001/02/02 00:09:16 1.3
@@ -264,13 +264,12 @@
</sql:statement>
</table></pre>
-<p><b>the "wasNull" tag</b></p>
+<p><b>"wasNull" and "wasNotNull" tags</b></p>
<p>The "wasNull" tag only executes its body if the previous "getColumn" tag
encountered a
null value in the database. You can only use the "wasNull" tag if you are
-inside a resultset and if a "getColumn" tag has already been executed. Setting the
-optional "value" attribute to "false" means that the tag body will only be executed
-if the previous get* tag did <i>not</i> produce a null.</p>
+inside a resultset and if a "getColumn" tag has already been executed. wasNotNull
+executes its body if the previous getColumn tag did <i>not</i> produce a null.</p>
<p><b>"getColumn" tag</b></p>
@@ -458,10 +457,15 @@
</TR>
<TR>
<TD><A HREF="#wasNull">wasNull</A></TD>
- <TD>execute the tag body if the last "get" tag encountered a null
+ <TD>execute the tag body if the last "getColumn" tag encountered a null
in the database</TD>
</TR>
<TR>
+ <TD><A HREF="#wasNotNull">wasNotNull</A></TD>
+ <TD>execute the tag body if the last "getColumn" tag did not encounter a null
+ in the database</TD>
+ </TR>
+ <TR>
<TD><A HREF="#getColumn">getColumn</A></TD>
<TD>Gets a column value from the database</TD>
</TR>
@@ -1636,9 +1640,7 @@
</TR>
<TR>
<TD COLSPAN="2">Executes its body if the last getColumn tag received a null value
-from the database. Setting the "value" attribute to false will
-execute the tag body if the last getColumn tag did not
-return a null. You must be inside a resultset tag and there must
+from the database. You must be inside a resultset tag and there must
be a previous getColumn tag, or an error will be generated.</TD>
</TR>
<TR>
@@ -1659,30 +1661,75 @@
</TR>
<TR>
<TD WIDTH="20%"><B>Attributes</B></TD>
- <TD WIDTH="80%"> </TD>
+ <TD WIDTH="80%">None</TD>
</TR>
+ <TR><TD WIDTH="20%"><B>Properties</B></TD><TD>None</TD></TR>
<TR>
- <TD WIDTH="20%"> </TD>
+ <TD WIDTH="20%" VALIGN="TOP"><B>Example</B></TD>
<TD WIDTH="80%">
- <TABLE BORDER="0" WIDTH="100%">
- <TR>
- <TD WIDTH="40%">Name</TD>
- <TD WIDTH="20%">Required</TD>
- <TD WIDTH="40%">Runtime Expression Evaluation</TD>
- </TR>
- <TR BGCOLOR="#CCCCCC">
- <TD WIDTH="40%"><B> value</B></TD>
- <TD WIDTH="20%"> No</TD>
- <TD WIDTH="40%"> No</TD>
- </TR>
- <TR>
- <TD COLSPAN="3">If set to false, the body of the tag
- will not be executed if the last getColumn
- tag encountered a null.</TD>
- </TR>
- </TABLE>
+ <br>
+
+<pre><%-- open a database query --%>
+<table>
+<sql:statement id="stmt1" conn="conn1">
+ <sql:query>
+ select id, name, description from test_books
+ order by 1
+ </sql:query>
+ <%-- loop through the rows of your query --%>
+ <sql:resultSet id="rset2">
+ <tr>
+ <td><sql:getColumn position="1"/></td>
+ <td><sql:getColumn position="2"/></td>
+ <td><sql:getColumn position="3"/>
+ <sql:wasNull>[no description]</sql:wasNull></td>
+ </tr>
+ </sql:resultSet>
+</sql:statement>
+</table></pre>
</TD>
</TR>
+ </TABLE>
+ </TD>
+ </TR>
+</TABLE>
+
+<TABLE BORDER="0" WIDTH="90%" CELLPADDING="3" CELLSPACING="0">
+ <TR>
+ <TD COLSPAN="2">
+ <TABLE BORDER="0" BGCOLOR="#CCCCCC" WIDTH="100%" CELLSPACING="0">
+ <TR>
+ <TD><B><FONT SIZE="+1"><A
NAME="wasNotNull"> wasNotNull</A></FONT></B></TD>
+ <TD ALIGN="RIGHT">Availability: version 1.0 </TD>
+ </TR>
+ </TABLE>
+ </TD>
+ </TR>
+ <TR>
+ <TD COLSPAN="2">Executes its body if the last getColumn tag did not encounter a
+ null value from the database. You must be inside a resultset tag and there
+ must be a previous getColumn tag, or an error will be generated.</TD>
+ </TR>
+ <TR>
+ <TD WIDTH="2%"> </TD>
+ <TD WIDTH="98%">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR>
+ <TD WIDTH="20%"><B>Tag Body</B></TD>
+ <TD WIDTH="80%">JSP</TD>
+ </TR>
+ <TR>
+ <TD WIDTH="20%"><B>Script Variable</B></TD>
+ <TD WIDTH="80%">No</TD>
+ </TR>
+ <TR>
+ <TD WIDTH="20%"><B>Restrictions</B></TD><TD>Must be used following a
+ getColumn tag.</TD>
+ </TR>
+ <TR>
+ <TD WIDTH="20%"><B>Attributes</B></TD>
+ <TD WIDTH="80%">None</TD>
+ </TR>
<TR><TD WIDTH="20%"><B>Properties</B></TD><TD>None</TD></TR>
<TR>
<TD WIDTH="20%" VALIGN="TOP"><B>Example</B></TD>
@@ -1701,8 +1748,8 @@
<tr>
<td><sql:getColumn position="1"/></td>
<td><sql:getColumn position="2"/></td>
- <td><sql:getColumn position="3"/>
- <sql:wasNull>[no description]</sql:wasNull></td>
+ <td><sql:getColumn position="3" to="description"/>
+ <sql:wasNotNull>Description: <%=
pageContext.getAttribute("description") %></sql:wasNotNull></td>
</tr>
</sql:resultSet>
</sql:statement>