I have tested this servlet开发者_开发技巧 and it works well, except in Google Chrome it jsut doesn't display image. What could be wrong in this example code that makes Chrome not to display image?
http://balusc.blogspot.com/2007/04/imageservlet.html
I suspect that the following line was missing:
response.setHeader("Content-Length", String.valueOf(image.length()));
Some browsers may namely be picky on that.
精彩评论