jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From catl...@apache.org
Subject cvs commit: jakarta-taglibs/random/doc/web index.html
Date Mon, 21 May 2001 20:41:25 GMT
catlett     01/05/21 13:41:25

  Added:       random/doc/web index.html
  Log:
  first import of random taglib
  
  Revision  Changes    Path
  1.1                  jakarta-taglibs/random/doc/web/index.html
  
  Index: index.html
  ===================================================================
  <HTML>
  
  <HEAD>
   <TITLE>Jakarta Project: RANDOM JSP Tag Library</TITLE>
  </HEAD>
  
  <BODY BGCOLOR="white">
  <CENTER>
  <H1>Jakarta Project: RANDOM JSP Tag Library</H1>
  <H3>Version 1.0</H3>
  </CENTER>
  
  <H3>Table of Contents</H3>
  <A HREF="#overview">Overview</A><BR>
  <A HREF="#requirements">Requirements</A><BR>
  <A HREF="#config">Configuration</A><BR>
  <A HREF="#summary">Tag Summary</A><BR>
  <A HREF="#reference">Tag Reference</A><BR>
  <A HREF="#examples">Examples</A><BR>
  <A HREF="#javadocs">Javadocs</A><BR>
  <A HREF="#history">Revision History</A><BR>
  <BR>
  
  <A NAME="overview"><H3>Overview</H3></A>
  <P>The Random tag library creates random strings and random numbers. You may
  specify a set of allowable characters as well as the length for randomly
  generated strings. You may specify a range of allowable integers or a 
  random floating point number between zero and one for randomly generated 
  numbers.</P>
  
  <A NAME="requirements"><H3>Requirements</H3></A>
  <P>This custom tag library requires no software other than a servlet container
  that supports the JavaServer Pages Specification, version 1.1.</P> 
  
  <A NAME="config"><H3>Configuration</H3></A>
  <P>Follow these steps to configure your web application with this tag library:
  </P>
  <UL>
  <LI>Copy the tag library descriptor file (<TT>random/random.tld</TT>)
to the <TT>/WEB-INF</TT> 
  subdirectory of your web application.</LI>
  <LI>Copy the tag library JAR file (<TT>random/random.jar</TT>) to the
<TT>/WEB-INF/lib</TT> 
  subdirectory of your web application.</LI>
  <LI>Add a &lt;taglib&gt; element to your web application deployment descriptor
  in <TT>/WEB-INF/web.xml</TT> like this:<BR>
  <BR>
  <PRE>
  &lt;taglib&gt;
    &lt;taglib-uri&gt;http://jakarta.apache.org/taglibs/random&lt;/taglib-uri&gt;
    &lt;taglib-location&gt;/WEB-INF/random.tld&lt;/taglib-location&gt;
  &lt;/taglib&gt;
  </PRE>
  </LI>
  </UL>
  <P>To use the tags from this library in your JSP pages, add the following
  directive at the top of each page: </P>
  <PRE>
  &lt;%@ taglib uri=&quot;random.jar&quot; prefix=&quot;rand&quot; %&gt;
  </PRE>
  <P>where &quot;<I>rand</I>&quot; is the tag name prefix you wish
to use for
  tags from this library. You can change this value to any prefix you like.
  The prefix <B>rand</B> is used in the examples below.</P>
  
  <A NAME="summary"><H3>Tag Summary</H3></A>
  <TABLE>
   <TR>
    <TD COLSPAN="2"><B>Random Tags</B></TD>
   </TR>
   <TR>
    <TD><A HREF="#string">string</A></TD>
    <TD></TD>
   </TR>
   <TR>
    <TD><A HREF="#number">number</A></TD>
    <TD></TD>
   </TR>
  </TABLE>
  
  <A NAME="reference"><H3>Tag Reference</H3></A>
  <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="string">&nbsp;string</A></FONT></B></TD>
       <TD ALIGN="RIGHT">Availability: version 1.0&nbsp;</TD>
      </TR>
     </TABLE>
    </TD>
   </TR>
   <TR>
    <TD COLSPAN="2">Set the properties of a variable length random string generator.
  	          A new random string will be created every time the 
  	          <b>jsp:getProperty</b> tag is used to access the generator.
    </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%">empty</TD>
      </TR>
      <TR>
       <TD WIDTH="20%"><B>Script Variable</B></TD>
       <TD WIDTH="80%">Yes</TD>
      </TR>
      <TR>
       <TD WIDTH="20%"><B>Restrictions</B></TD>
       <TD WIDTH="80%">None</TD>
      </TR>
      <TR>
       <TD WIDTH="20%"><B>Attributes</B></TD>
       <TD WIDTH="80%">&nbsp;</TD>
      </TR>
      <TR>
       <TD WIDTH="20%">&nbsp;</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;id</B></TD>
          <TD WIDTH="20%">&nbsp;Yes</TD>
          <TD WIDTH="40%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">Script variable for use with the standard 
  		        <B>jsp:getProperty</B> tag.
          </TD>
         </TR>
         <TR BGCOLOR="#CCCCCC">
          <TD WIDTH="40%"><B>&nbsp;length</B></TD>
          <TD WIDTH="20%">&nbsp;No</TD>
          <TD WIDTH="40%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">The length of the random string. Defaults to a length of 8.
  	</TD>
         </TR>
         <TR BGCOLOR="#CCCCCC">
          <TD WIDTH="40%"><B>&nbsp;map</B></TD>
          <TD WIDTH="20%">&nbsp;No</TD>
          <TD WIDTH="40%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">Attribute name of a Bean or Script variable which is a Java

  		        HashMap object.  The random string generated will be a new
  		        unique key for use as a key for the HashMap.
  	</TD>
         </TR>
         <TR BGCOLOR="#CCCCCC">
          <TD WIDTH="40%"><B>&nbsp;charset</B></TD>
          <TD WIDTH="20%">&nbsp;No</TD>
          <TD WIDTH="40%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">The set of characters to use when creating the random
  		        string. The following characters can be used as a<BR>charset
  		        <CODE>a-zA-Z0-9 ! @ # $ % ^ & * ( ) _ \- + = { } [ ] \\ 
  		        | : ; \" ' &lt; &gt; , . ? /</CODE>
  		        <BR>The backslash, hyphen, and double quotes
  		        characters must be escaped with a \: like this 
  		        \\, \-, and \".  
  		        Lowercase alpha characters can be specified using
  		        a range like "a-z" or "f-r", the same can be done with
  		        uppercase letters A-Z and digits 0-9.  To use the entire
  		        character set, set charset=&quot;all&quot;.
  		        Single characters must be separated by a space.
  		        Charset defaults to a value of a-zA-Z0-9.
  	</TD>
         </TR>
        </TABLE>
       </TD>
      </TR>
      <TR>
       <TD COLSPAN=2 WIDTH="100%"><B>Properties</B></TD>
      </TR>
      <TR>
       <TD WIDTH="20%">&nbsp;</TD>
       <TD WIDTH="80%">
        <TABLE BORDER="0" WIDTH="100%">
         <TR>
          <TD WIDTH="60%">Name</TD>
          <TD WIDTH="20%">Get</TD>
          <TD WIDTH="20%">Set</TD>
         </TR>
         <TR BGCOLOR="#CCCCCC">
          <TD WIDTH="60%"><B>&nbsp;random</B></TD>
          <TD WIDTH="20%">&nbsp;Yes</TD>
          <TD WIDTH="20%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">Returns the variable length randomly generated string from
  		        the named generator.</TD>
         </TR>
        </TABLE>
       </TD>
      </TR>
      <TR>
       <TD WIDTH="20%" VALIGN="TOP"><B>Example</B></TD>
       <TD WIDTH="80%"><BR>
  <PRE>
  &lt;!-- Create a random string that is 8 characters long and that --&gt;
  &lt;!-- uses a charset of all characters --&gt;
  &lt;rand:string id=&quot;random1&quot; charset=&quot;all&quot;/&gt;
  
  &lt;!-- Get the random string that was set up above, with a --&gt;
  &lt;!--<B>jsp:getProperty</B> tag --&gt;
  &lt;jsp:getProperty name=&quot;random1&quot; property=&quot;random&quot;/&gt;
  
  &lt;!-- Create a random string that only uses uppercase letters --&gt;
  &lt;rand:string id=&quot;random2&quot; charset=&quot;A-Z&quot;/>
  
  &lt;!-- Get the random string that was set up above, with a --&gt;
  &lt;!--<B>jsp:getProperty</B> tag --&gt;
  &lt;jsp:getProperty name=&quot;random2&quot; property=&quot;random&quot;/&gt;
  
  &lt;!-- Create the same random string as above only make it --&gt;
  &lt;!-- 15 character long --&gt;
  &lt;rand:string id=&quot;random3&quot; charset=&quot;A-Z&quot; length=&quot;15&quot;/>
  
  &lt;!-- Get the random string that was set up above, with a --&gt;
  &lt;!--<B>jsp:getProperty</B> tag --&gt;
  &lt;jsp:getProperty name=&quot;random3&quot; property=&quot;random&quot;/&gt;
  
  &lt;!-- Create a random string that uses the following charset --&gt;
  &lt;!-- A-Z ! @ # \\ \- + ? & $
  &lt;rand:string id=&quot;random4&quot; charset=&quot;A-Z ! @ # \\ \- + ?
& $&quot;/>
  
  &lt;!-- Get the random string that was set up above, with a --&gt;
  &lt;!--<B>jsp:getProperty</B> tag --&gt;
  &lt;jsp:getProperty name=&quot;random4&quot; property=&quot;random&quot;/&gt;
  
  &lt;!-- Create the default random string that uses a hashmap named --&gt;
  &lt;!-- passkeys to make sure each randomly created string is unique. --&gt;
  &lt;!-- This string defaults to a charset of a-zA-Z0-9. --&gt;
  &lt;rand:string id=&quot;random5&quot; map=&quot;passkeys&quot;/&gt;
  
  &lt;!-- Get the random string that was set up above, with a --&gt;
  &lt;!--<B>jsp:getProperty</B> tag --&gt;
  &lt;jsp:getProperty name=&quot;random5&quot; property=&quot;random&quot;/&gt;
  </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="number">&nbsp;number</A></FONT></B></TD>
       <TD ALIGN="RIGHT">Availability: version 1.0&nbsp;</TD>
      </TR>
     </TABLE>
    </TD>
   </TR>
   <TR>
    <TD COLSPAN="2">Set the properties of a random number generator.  A new random
  	          number will be generated each time the <B>jsp:getProperty</B> tag
  	          is used to access the generator .
    </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%">Yes</TD>
      </TR>
      <TR>
       <TD WIDTH="20%"><B>Restrictions</B></TD>
       <TD WIDTH="80%">None</TD>
      </TR>
      <TR>
       <TD WIDTH="20%"><B>Attributes</B></TD>
       <TD WIDTH="80%">&nbsp;</TD>
      </TR>
      <TR>
       <TD WIDTH="20%">&nbsp;</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;id</B></TD>
          <TD WIDTH="20%">&nbsp;Yes</TD>
          <TD WIDTH="40%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">Script variable for use with the standard 
  		        <B>jsp:getProperty</B> tag.
          </TD>
         </TR>
         <TR BGCOLOR="#CCCCCC">
          <TD WIDTH="40%"><B>&nbsp;range</B></TD>
          <TD WIDTH="20%">&nbsp;No</TD>
          <TD WIDTH="40%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">This parameter determines the lower and upper bound from
  		        which to select the random number.  If a range of 0-1 is
  		        selected, the tag will automatically create a float value
  		        between 0 and 1.  The default range is the digits 0 to 100.
  		        Max size of the random number is limited by the size of the
  		        primitive data type of long.
  	</TD>
         </TR>
        </TABLE>
       </TD>
      </TR>
      <TR>
       <TD COLSPAN=2 WIDTH="100%"><B>Properties</B></TD>
      </TR>
      <TR>
       <TD WIDTH="20%">&nbsp;</TD>
       <TD WIDTH="80%">
        <TABLE BORDER="0" WIDTH="100%">
         <TR>
          <TD WIDTH="60%">Name</TD>
          <TD WIDTH="20%">Get</TD>
          <TD WIDTH="20%">Set</TD>
         </TR>
         <TR BGCOLOR="#CCCCCC">
          <TD WIDTH="60%"><B>&nbsp;random</B></TD>
          <TD WIDTH="20%">&nbsp;Yes</TD>
          <TD WIDTH="20%">&nbsp;No</TD>
         </TR>
         <TR>
          <TD COLSPAN="3">Returns the randomly generated number as a Java Number object.
  		        In a JSP page the number is printed out as a string.</TD>
         </TR>
       </TABLE>
       </TD>
      </TR>
      <TR>
       <TD WIDTH="20%" VALIGN="TOP"><B>Example</B></TD>
       <TD WIDTH="80%"><BR>
  <PRE>
  &lt;!-- Create a default random number in the range 10000000-99999999. --&gt;
  &lt;rand:number id=&quot;random1&quot; range=&quot;10000000-99999999&quot;/&gt;
  
  &lt;!-- Get the random number, that was set up above,  using the --&gt;
  &lt;!-- <B>jsp:getProperty</B> tag. --&gt;
  &lt;jsp:getProperty name=&quot;random1&quot; property=&quot;random&quot;/&gt;
  
  &lt;!-- Create a random number that is a float value by setting the --&gt;
  &lt;!-- range to 0-1 --&gt;
  &lt;rand:number id=&quot;random2&quot; range=&quot;0-1&quot;/&gt;
  
  &lt;!-- Get the random number, that was set up above,  using the --&gt;
  &lt;!-- <B>jsp:getProperty</B> tag. --&gt;
  &lt;jsp:getProperty name=&quot;random2&quot; property=&quot;random&quot;/&gt;
  </PRE>
       </TD>
      </TR>
     </TABLE>
    </TD>
   </TR>
  </TABLE>
  
  
  <A NAME="examples"><H3>Examples</H3></A>
  <P>See random-examples.war for examples that use tags from this custom tag library.</P>
  
  <A NAME="javadocs"><H3>Javadocs</H3></A>
  <P>Java programmers can view the java class documentation for this tag library
  as <A HREF="javadoc/index.html">javadocs</A>.</P>
  
  <A NAME="history"><H3>Revision History</H3></A>
  <P>Review the complete <A HREF="changes.html">revision history</A> of
this tag
  library.</P>
  </BODY>
  </HTML>
  
  
  

Mime
View raw message