...
- Add the jcaptcha jar file into the WEB-INF/lib directory of your .war file
- If your app or server do not already have commons-logging and commons-collection into the WEB-INF/lib directory of your .war
- Put the reference in your web.xml (checking that the url-pattern path matches up with what you put in your html fragment above):
Code Block | ||||
---|---|---|---|---|
| ||||
<servlet> <servlet-name>jcaptcha</servlet-name> <servlet-class>com.octo.captcha.servlet.image.SimpleImageCaptchaServlet<servletSimpleImageCaptchaServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>jcaptcha</servlet-name> <url-pattern>/jcaptcha.jpg</url-pattern> </servlet-mapping> |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<form action="submit.action"> ... <img src="japtchajcaptcha.jpg" /> <input type="text" name="japtchajcaptcha" value="" /> ... </form> |
- In your code that manages the submit action add the following code fragment to validate the user input
...