To extend SimpleCaptcha and configure CAPTCHA, I understand that you will need to create your own HttpServlet(possibly extends SimpleCaptchaServlet). To do this, I suggest downloading the source code and looking at SimpleCaptchaServletor StickyCaptchaServlet. This is what the method looks like doGet() SimpleCaptchaServlet:
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Captcha captcha = new Captcha.Builder(_width, _height)
.addText()
.addBackground(new GradiatedBackgroundProducer())
.gimp()
.addNoise()
.addBorder()
.build();
CaptchaServletUtil.writeImage(resp, captcha.getImage());
req.getSession().setAttribute(NAME, captcha);
}
: Captcha Builder doGet(). Installing, web.xml. , / . examples. , , -.