@Component(value="captchaService") public class DefaultCaptchaService extends Object implements CaptchaService
CaptchaService.| Constructor and Description |
|---|
DefaultCaptchaService() |
| Modifier and Type | Method and Description |
|---|---|
BufferedImage |
createCaptcha(HttpSession session)
Creates a random captcha.
|
boolean |
isValidCaptcha(HttpSession session,
int x,
int y)
Checks if the captcha answer is valid.
|
public DefaultCaptchaService()
public BufferedImage createCaptcha(HttpSession session)
CaptchaServicecreateCaptcha in interface CaptchaServicesession - HttpSession to store the answer inBufferedImage generated captchapublic boolean isValidCaptcha(HttpSession session, int x, int y)
CaptchaServiceisValidCaptcha in interface CaptchaServicesession - HttpSession that contains the correct answerx - x position of the mouse clicky - y position of the mouse clicktrue if the captcha has been correctly answeredCopyright © 2011–2016. All rights reserved.