home configuration implementation extending download about



deploying
building
 

The war file in the distribution should run on any server with a servlet container. Until now I've only tested it on websphere 5 and jboss 3.x.

As for integration with your own application some simple steps:

1. drop the simplecaptcha.jar found in /dist/lib/ file in WEB-INF/lib of your webapp.
2. create the servlet mapping for the captcha servlet like:

<servlet>
<
servlet-name>Captcha</servlet-name>
<
display-name>Captcha</display-name>
<
servlet-class>nl.captcha.servlet.CaptchaServlet</servlet-class>
</servlet>

3. the mapping:

<servlet-mapping>
<servlet-name>Captcha</servlet-name>
<
url-pattern>/Captcha.jpg</url-pattern>
</
servlet-mapping>

4. in your jsp create an image tag: <img src="Captcha.jpg"> and create a form text input to hold user input. 

5. in your controller check the value from the text field against the captcha key stored in the session: (String)session.getAttribute(nl.captcha.servlet.Constants.SIMPLE_CAPCHA_SESSION_KEY) ;

Note that with each request to the servlet the current value of the key in the session is replaced with a new one.

Without additional configuration the java capcha will render as:

default java captcha

If you managed to integrate simple captcha with an existing application feel free to let me know either through the soucefourge mailing list or one of the forums.

SourceForge Logo