Custom JSP taglib. Lets you provide a "human test" for you input.
Tag MathQuestion generates a random expression and saves the result in session scope.
You can ask about this result in your HTML form and compare the input with the value
saved in session. It could be a proof that your page is not submitted from some automated application (math captcha).
For example:
<%@ taglib uri="taglib.tld" prefix="q" %> <form ... > <q:MathQuestion /> ... </form> and you will get some like this: you can disable automatic generation for the input filed and do it by your own. E.g.:
<%@ taglib uri="taglib.tld" prefix="q" %> <form ... > <q:MathQuestion input="false" /> <%=_Expression%> = <input type="text" name="answer"> ... </form> in your servlet (JSP page) processes the input you can compare two value:
Actually tag creates the following page scope variables: _Expression (type is java.lang.String) - generated expression
Tags are: MathQuestion tag generates a random math question. Parameters are: for downloading:
Library: mquestiontag.jar Description: taglib.tld
© Coldbeans
Comments, suggestions?
See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|