-1

If i download a image from my image-servlet from home, everything is ok.

But if i download the image from work, the image will download, but the tcp-connection looks like never ending.

public class ImageServlet extends HttpServlet {
    protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException {
        // ...
        ServletOutputStream servetOutputStream = response.getOutputStream();
        ImageIO.write(bufferedImage, imageRequestWrapper.mimeType, servetOutputStream);
        servetOutputStream.close();
    }
}

Any Suggestions?

4

2 に答える 2

0

I tried your link and it works fine for me. I just can suppose that the cause of your problem is HTTP proxy or router or firewall or NAT or ??? defined at your work.

So, first you can try to disable one of these things (if it is possible). HTTP proxy is the first candidate. For other things try to contact your system administrator.

If nothing helps but this is your servlet try to post here its source code. Otherwise it is impossible to suggest anything.

于 2013-01-17T17:29:48.723 に答える
0

Ok,

i finally fixed it by write the content-length. Without content-length the Header-Line

Encoding-Type: chunked 

keeps the Connection alive!

于 2013-01-17T18:43:39.503 に答える