15.9.2. Adding a CAPTCHA to a form
It is easy to add a CAPTCHA challenge to a form:
<h:graphicImage value="/seam/resource/captcha"/> <h:inputText id="verifyCaptcha" value="#{captcha.response}" required="true"> <s:validate /> </h:inputText> <h:message for="verifyCaptcha"/>
That is all you need to do. The
graphicImage
control displays the CAPTCHA challenge, and the inputText
receives the user's response. The response is automatically validated against the CAPTCHA when the form is submitted.