protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
HttpSession httpsession = request.getSession();
response.setContentType("image/jpeg");
ServletOutputStream servletoutputstream = response.getOutputStream();
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0L);
BufferedImage bufferedimage = new BufferedImage(WIDTH, HEIGHT, 1);
Graphics g = bufferedimage.getGraphics();
char ac[] = generateCheckCode();
drawBackground(g);
drawRands(g, ac);
g.dispose();
ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
ImageIO.write(bufferedimage, "JPEG", bytearrayoutputstream);
byte abyte0[] = bytearrayoutputstream.toByteArray();
response.setContentLength(abyte0.length);
servletoutputstream.write(abyte0);
bytearrayoutputstream.close();
servletoutputstream.close();
httpsession.setAttribute("check_code", new String(ac));
}