@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)
CaptchaService
createCaptcha
in interface CaptchaService
session
- HttpSession
to store the answer inBufferedImage
generated captchapublic boolean isValidCaptcha(HttpSession session, int x, int y)
CaptchaService
isValidCaptcha
in interface CaptchaService
session
- 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.