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 <taglib> element to your web application deployment descriptor
in <TT>/WEB-INF/web.xml</TT> like this:<BR>
<BR>
<PRE>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/random</taglib-uri>
<taglib-location>/WEB-INF/random.tld</taglib-location>
</taglib>
</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>
<%@ taglib uri="random.jar" prefix="rand" %>
</PRE>
<P>where "<I>rand</I>" 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"> string</A></FONT></B></TD>
<TD ALIGN="RIGHT">Availability: version 1.0 </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%"> </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%"> </TD>
</TR>
<TR>
<TD WIDTH="20%"> </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> id</B></TD>
<TD WIDTH="20%"> Yes</TD>
<TD WIDTH="40%"> 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> length</B></TD>
<TD WIDTH="20%"> No</TD>
<TD WIDTH="40%"> 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> map</B></TD>
<TD WIDTH="20%"> No</TD>
<TD WIDTH="40%"> 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> charset</B></TD>
<TD WIDTH="20%"> No</TD>
<TD WIDTH="40%"> 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 ! @ # $ % ^ & * ( ) _ \- + = { } [ ] \\
| : ; \" ' < > , . ? /</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="all".
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%"> </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> random</B></TD>
<TD WIDTH="20%"> Yes</TD>
<TD WIDTH="20%"> 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>
<!-- Create a random string that is 8 characters long and that -->
<!-- uses a charset of all characters -->
<rand:string id="random1" charset="all"/>
<!-- Get the random string that was set up above, with a -->
<!--<B>jsp:getProperty</B> tag -->
<jsp:getProperty name="random1" property="random"/>
<!-- Create a random string that only uses uppercase letters -->
<rand:string id="random2" charset="A-Z"/>
<!-- Get the random string that was set up above, with a -->
<!--<B>jsp:getProperty</B> tag -->
<jsp:getProperty name="random2" property="random"/>
<!-- Create the same random string as above only make it -->
<!-- 15 character long -->
<rand:string id="random3" charset="A-Z"
length="15"/>
<!-- Get the random string that was set up above, with a -->
<!--<B>jsp:getProperty</B> tag -->
<jsp:getProperty name="random3" property="random"/>
<!-- Create a random string that uses the following charset -->
<!-- A-Z ! @ # \\ \- + ? & $
<rand:string id="random4" charset="A-Z ! @ # \\ \- + ? & $"/>
<!-- Get the random string that was set up above, with a -->
<!--<B>jsp:getProperty</B> tag -->
<jsp:getProperty name="random4" property="random"/>
<!-- Create the default random string that uses a hashmap named -->
<!-- passkeys to make sure each randomly created string is unique. -->
<!-- This string defaults to a charset of a-zA-Z0-9. -->
<rand:string id="random5" map="passkeys"/>
<!-- Get the random string that was set up above, with a -->
<!--<B>jsp:getProperty</B> tag -->
<jsp:getProperty name="random5" property="random"/>
</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"> number</A></FONT></B></TD>
<TD ALIGN="RIGHT">Availability: version 1.0 </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%"> </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%"> </TD>
</TR>
<TR>
<TD WIDTH="20%"> </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> id</B></TD>
<TD WIDTH="20%"> Yes</TD>
<TD WIDTH="40%"> 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> range</B></TD>
<TD WIDTH="20%"> No</TD>
<TD WIDTH="40%"> 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%"> </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> random</B></TD>
<TD WIDTH="20%"> Yes</TD>
<TD WIDTH="20%"> 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>
<!-- Create a default random number in the range 10000000-99999999. -->
<rand:number id="random1" range="10000000-99999999"/>
<!-- Get the random number, that was set up above, using the -->
<!-- <B>jsp:getProperty</B> tag. -->
<jsp:getProperty name="random1" property="random"/>
<!-- Create a random number that is a float value by setting the -->
<!-- range to 0-1 -->
<rand:number id="random2" range="0-1"/>
<!-- Get the random number, that was set up above, using the -->
<!-- <B>jsp:getProperty</B> tag. -->
<jsp:getProperty name="random2" property="random"/>
</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>