net.tanesha.recaptcha
Interface ReCaptcha

All Known Implementing Classes:
ReCaptchaImpl

public interface ReCaptcha


Method Summary
 ReCaptchaResponse checkAnswer(java.lang.String remoteAddr, java.lang.String challenge, java.lang.String response)
          Validates a reCaptcha challenge and response.
 java.lang.String createRecaptchaHtml(java.lang.String errorMessage, java.util.Properties options)
          Creates HTML output with embedded recaptcha.
 java.lang.String createRecaptchaHtml(java.lang.String errorMessage, java.lang.String theme, java.lang.Integer tabindex)
          Creates HTML output with embedded recaptcha.
 

Method Detail

createRecaptchaHtml

java.lang.String createRecaptchaHtml(java.lang.String errorMessage,
                                     java.util.Properties options)
Creates HTML output with embedded recaptcha. The string response should be output on a HTML page (eg. inside a JSP).

Parameters:
errorMessage - An errormessage to display in the captcha, null if none.
options - Options for rendering, tabindex and theme are currently supported by recaptcha. You can put any options here though, and they will be added to the RecaptchaOptions javascript array.
Returns:

createRecaptchaHtml

java.lang.String createRecaptchaHtml(java.lang.String errorMessage,
                                     java.lang.String theme,
                                     java.lang.Integer tabindex)
Creates HTML output with embedded recaptcha. The string response should be output on a HTML page (eg. inside a JSP). This is just a wrapper that accepts the properties known to recaptcha.net

Parameters:
errorMessage - The error message to show in the recaptcha ouput
theme - The theme to use for the recaptcha output (null if default)
tabindex - The tabindex to use for the recaptcha element (null if default)
Returns:

checkAnswer

ReCaptchaResponse checkAnswer(java.lang.String remoteAddr,
                              java.lang.String challenge,
                              java.lang.String response)
Validates a reCaptcha challenge and response.

Parameters:
remoteAddr - The address of the user, eg. request.getRemoteAddr()
challenge - The challenge from the reCaptcha form, this is usually request.getParameter("recaptcha_challenge_field") in your code.
response - The response from the reCaptcha form, this is usually request.getParameter("recaptcha_response_field") in your code.
Returns:


Copyright © 2007-2010. All Rights Reserved.