public interface CaptchaService
In a first step, the captcha is created, and the correct answer is stored in the http session.
In a second step, the coordinates of the user's click within the captcha is evaluated.
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.
|
BufferedImage createCaptcha(HttpSession session)
session
- HttpSession
to store the answer inBufferedImage
generated captchaboolean isValidCaptcha(HttpSession session, int x, int y)
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.