@Scope(proxyMode=TARGET_CLASS,
value="session")
@Service
public class CaptchaService
extends java.lang.Object
| Constructor and Description |
|---|
CaptchaService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
consumeCaptcha(java.lang.String captchaAnswer)
Validates and consumes a captcha.
|
java.awt.image.BufferedImage |
createCaptcha(int width,
int height)
Creates a
Captcha and stores it in the session. |
boolean |
validateCaptcha(java.lang.String captchaAnswer)
Validates a captcha answer.
|
public java.awt.image.BufferedImage createCaptcha(int width,
int height)
Captcha and stores it in the session.width - the width of the imageheight - the height of the imageBufferedImage containing the captcha imagepublic boolean validateCaptcha(java.lang.String captchaAnswer)
throws CaptchaException
captchaAnswer - the String to validateCaptchaException - if no captcha found to validatepublic boolean consumeCaptcha(java.lang.String captchaAnswer)
throws CaptchaException
CaptchaException - if no captcha found to consumeCopyright © 2014. All Rights Reserved.