osx web service spawns icon in taskbar - osx - while drawing image

Posted by wuntee on Stack Overflow See other posts from Stack Overflow or by wuntee
Published on 2010-05-21T19:10:05Z Indexed on 2010/05/21 19:10 UTC
Read the original article Hit count: 1046

Filed under:

I have a web endpoint that displays an image of a string... When the following code is run (in tomcat) it spawns a java icon in the taskbar on OSX. Not sure if it is a problem, or whats going on. Looking for some sort of explination

public void textImage(HttpServletResponse response, @PathVariable("text") String text){

        OutputStream os = response.getOutputStream();

        BufferedImage bufferedImage = new BufferedImage( (text.length()*10) , 14, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2d = bufferedImage.createGraphics();
        Font font = new Font("sansserif", Font.PLAIN, 12);
        g2d.drawString(text, 0, 12);

        ImageIO.write(bufferedImage, "png", os);
    } catch(Exception e) {
        // nothing we can do, simply log the error
        logger.error("Could not draw string: ", e);

© Stack Overflow or respective owner

Related posts about osx

Related posts about web-services