1.0.2
1.1
random
http://jakarta.apache.org/taglibs/random-1.0
Random Tag library
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.
string
org.apache.taglibs.random.RandomStrgTag
org.apache.taglibs.random.RandomStrgTEI
Empty
string
Set the properties of a variable length random string generator. A new
random string will be created every time the jsp:getProperty tag
is used to access the generator.
Set the properties of a variable length random string generator. A new
random string will be created every time the jsp:getProperty tag is
used to access the generator.
id
org.apache.taglibs.random.RandomStrg
true
AT_END
Name used to retrieve the random string later in the page.
random
Yes
No
The variable length randomly generated string from the named
generator.
id
yes
no
Script variable for use with the standard jsp:getProperty tag.
length
no
no
The length of the random string. Defaults to a length of 8.
map
no
no
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.
charset
no
no
The set of characters to use when creating the random string. The
following characters can be used as a charset a-zA-Z0-9
! @ # $ % ^ & * ( ) _ \- + = { } [ ] \\ | : ; \" ' < > , . ? /
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.
algorithm
no
no
The algorithm to be used if a SecureRandom object is going to be used to
generate the random string.
provider
no
no
The package to search for the desired algorithm that is to be used for a
SecureRandom object.
Create a random string that is 8 characters long and that uses a charser of all characters.
]]>
Get the random string that was set up above, with a jsp:getProperty tag.
]]>
Create a random string that only uses uppercase letters.
]]>
Get the random string that was set up above, with a jsp:getProperty tag.
]]>
Create the same random string as above only make it 15 characters long.
]]>
Get the random string that was set up above, with a jsp:getProperty tag.
]]>
Create a random string that uses the following charset A-Z ! @ # \\ \- + ? & $
]]>
Get the random string that was set up above, with a jsp:getProperty tag.
]]>
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.
]]>
Get the random string that was set up above, with a jsp:getProperty tag.
]]>
Use the algorithm and provider attributes to use a SecureRandom object instead
of just a Random object when creating the random string. Use the default
settings for range and length of the string. The algorithm is SHA1PRNG and the
provider is SUN.
]]>
Get the random string that was set up above, with a jsp:getProperty tag.
]]>
number
org.apache.taglibs.random.RandomNumTag
org.apache.taglibs.random.RandomNumTEI
Empty
number
Set the properties of a random number generator. A new random number
will be generated each time the jsp:getProperty tag is used to
access the generator.
Set the properties of a random number generator. A new random number
will be generated each time the jsp:getProperty tag is used to
access the generator .
id
org.apache.taglibs.random.RandomNum
true
AT_END
Name used to retrieve the random number later in the page.
random
Yes
No
The variable length randomly generated number as a Java Number
object. In a JSP page the number is printed out as a string.
id
yes
no
Script variable for use with the standard jsp:getProperty tag.
range
no
no
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.
algorithm
no
no
The algorithm to be used if a SecureRandom object is going to be used to
generate the random string.
provider
no
no
The package to search for the desired algorithm that is to be used for a
SecureRandom object.
Create a default random number in the range 10000000-99999999.
]]>
Get the random number that was set up above, using the jsp:getProperty tag.
]]>
Create a random number that is a float value by setting the range to 0-1.
]]>
Get the random number that was set up above, using the jsp:getProperty tag.
]]>
Use the algorithm and provider attributes to use a SecureRandom object instead
of just a Random object when creating the random string. Use the default settings
for range of the number. The algorithm is SHA1PRNG and the provider is SUN.
]]>
Get the random number that was set up above, using the jsp:getProperty tag.
]]>