<% @ page autoflush = "false" import = "java.awt. *, java.awt.codec.jpeg. *, java.util. *"%> <% OUT. CLEAR (); response.setContentType ("image / jpeg"); response.addheader ("prgma", "no-cache"); response.addheader ("cache-control", "no-cache"); response.adddateHeader ( "Expries", 0); int width = 640, height = 480; BufferedImage image = new BufferedImage (width, height, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics (); g.setColor (Color.white); G. FillRect (0, 0, Width, Height); G.SetColor (Color.red); G.drawString ("OK", 270, 220); G.Drawoval (10, 10, 100, 100); g.dispose (); servletoutputstream Sos = response.getOutputStream (); JPEGIMAGEENCODER Encoder = JPEGCODEC.CREATEJPEGENCODER (SOS); encoder.encode (image); sos.close ();%>