@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
HttpSession session = req.getSession();
Captcha captcha;
if (session.getAttribute(NAME) == null) {
captcha = new Captcha.Builder(_width, _height)
.addText(new ChineseTextProducer())
.gimp()
.addBorder()
.addNoise()
.addBackground(new GradiatedBackgroundProducer())
.build();
session.setAttribute(NAME, captcha);
CaptchaServletUtil.writeImage(resp, captcha.getImage());
return;
}
captcha = (Captcha) session.getAttribute(NAME);
CaptchaServletUtil.writeImage(resp, captcha.getImage());
}