Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Walter Stroebel
Added: Mar 26, 2018 3:12 PM
Views: 21
Tags: no tags
  1.     protected void processRequest(HttpServletRequest request, HttpServletResponse response)
  2.             throws ServletException, IOException {
  3.         response.setContentType("image/png");
  4.         try (OutputStream out = response.getOutputStream()) {
  5.             BaseImage bi = new BaseImage(320, 200);
  6.             ImageIO.write(bi, "PNG", out);
  7.         }
  8.     }
  9.