catlett 01/05/21 13:46:29 Added: random/examples/web random.jsp Log: first import of random taglib Revision Changes Path 1.1 jakarta-taglibs/random/examples/web/random.jsp Index: random.jsp =================================================================== <%@ taglib uri="http://jakarta.apache.org/taglibs/random" prefix="rand" %> <html> <%@ page language="java" session="false" %> <head> <title>Example JSP for the Random taglib</title> </head> <body bgcolor="#FFFFFF"> <p>Create a random number between 10000000 and 99999999<br> <rand:number id="random" range="10000000-99999999"/><br> <jsp:getProperty name="random" property="random"/></p> <p>Create a random float value<br> <rand:number id="floater" range="0-1"/><br> <jsp:getProperty name="floater" property="random"/></p> <p>Create a random number between 25 and 100<br> <rand:number id="num25" range="25-100"/><br> <jsp:getProperty name="num25" property="random"/></p> <p>Create a random string of all the characters and digits<br> <rand:string id="random1" charset="all"/><br> <jsp:getProperty name="random1" property="random"/></p> <p>Get another random string same as above using the jsp:getProperty tag again<br> <br><jsp:getProperty name="random1" property="random"/></p> <p>Create a random string that is the default 8 chars long that uses the charset a-zA-Z0-9<br> <rand:string id="rand" charset="a-zA-Z0-9"/><br> <jsp:getProperty name="rand" property="random"/></p> <p>Create a random string 15 lowercase letters long<br> <rand:string id="random2" length="15" charset="a-z"/><br> <jsp:getProperty name="random2" property="random"/></p> <p>Create a random string with only caps<br> <rand:string id="random3" charset="A-Z"/><br> <jsp:getProperty name="random3" property="random"/></p> <p>Create a random string 10 characters long with the charset a-fF-K ! \\ $ % # ^ \- * ? notice that the - and \ had to be escaped with a \ <br> <rand:string id="last" length="10" charset="a-fF-K ! \\ $ % # ^ \- * ?"/><br> <jsp:getProperty name="last" property="random"/></p> <p>Get another random string same as above with the jsp:getProperty tag<br> <br><jsp:getProperty name="last" property="random"/></p> </body> </html>
