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>
   &lt;/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%">&nbsp;</TD>
  +     <TD WIDTH="80%">None</TD>
       </TR>
  +    <TR><TD WIDTH="20%"><B>Properties</B></TD><TD>None</TD></TR>
       <TR>
  -     <TD WIDTH="20%">&nbsp;</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>&nbsp;value</B></TD>
  -        <TD WIDTH="20%">&nbsp;No</TD>
  -        <TD WIDTH="40%">&nbsp;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>&lt;%-- open a database query --%>
  +&lt;table>
  +&lt;sql:statement id="stmt1" conn="conn1"> 
  +  &lt;sql:query>
  +    select id, name, description from test_books
  +    order by 1
  +  &lt;/sql:query>
  +  &lt;%-- loop through the rows of your query --%>
  +  &lt;sql:resultSet id="rset2">
  +    &lt;tr>
  +      &lt;td>&lt;sql:getColumn position="1"/>&lt;/td>
  +      &lt;td>&lt;sql:getColumn position="2"/>&lt;/td>
  +      &lt;td>&lt;sql:getColumn position="3"/>
  +          &lt;sql:wasNull>[no description]&lt;/sql:wasNull>&lt;/td>
  +    &lt;/tr>
  +  &lt;/sql:resultSet>
  +&lt;/sql:statement>
  +&lt;/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">&nbsp;wasNotNull</A></FONT></B></TD>
  +     <TD ALIGN="RIGHT">Availability: version 1.0&nbsp;</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%">&nbsp;</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 @@
       &lt;tr>
         &lt;td>&lt;sql:getColumn position="1"/>&lt;/td>
         &lt;td>&lt;sql:getColumn position="2"/>&lt;/td>
  -      &lt;td>&lt;sql:getColumn position="3"/>
  -          &lt;sql:wasNull>[no description]&lt;/sql:wasNull>&lt;/td>
  +      &lt;td>&lt;sql:getColumn position="3" to="description"/>
  +          &lt;sql:wasNotNull>Description: &lt;%= 
pageContext.getAttribute("description") %>&lt;/sql:wasNotNull>&lt;/td>
       &lt;/tr>
     &lt;/sql:resultSet>
   &lt;/sql:statement>
  
  
  

Reply via email to