@Scope(proxyMode=TARGET_CLASS,
value="session")
@Service
public class CaptchaService
extends Object
| Constructor and Description |
|---|
CaptchaService() |
| Modifier and Type | Method and Description |
|---|---|
BufferedImage |
createCaptcha(int width,
int height)
Creates a
Captcha and stores it in the session. |
void |
removeCaptcha() |
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 void removeCaptcha()
Copyright © 2016. All Rights Reserved.