@Scope(proxyMode=TARGET_CLASS,
value="session")
@Service
public class CaptchaService
extends Object
| Constructor and Description |
|---|
CaptchaService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
consumeCaptcha(String captchaAnswer)
Validates and consumes a captcha.
|
BufferedImage |
createCaptcha(int width,
int height)
Creates a
Captcha and stores it in the session. |
boolean |
validateCaptcha(String captchaAnswer)
Validates a captcha answer.
|
public 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(String captchaAnswer) throws CaptchaException
captchaAnswer - the String to validateCaptchaException - if no captcha found to validatepublic boolean consumeCaptcha(String captchaAnswer) throws CaptchaException
CaptchaException - if no captcha found to consumeCopyright © 2015. All Rights Reserved.