We are trying to create an image manager servlet. We pass it information and it returns the image that we need. Not the text to get the image, but the byte stream of the image. Since the browser is expecting a byte stream of image data, we have set the servlet content type to "image/jpg". However, this is not working.
This is how we originally planned to use it:
<img src="/ImgMgr?name=imgName">
We realized that the browser was expecting some extension. So we added JavaScript:
<img id="documentImage" src="/images/blankImage.jpg">
<script language="JavaScript">
document.getElementById("documentImage"
.src = "/ImgMgr?name=imgName" + ".jpg";
</script>
This all sounded good until we realized that the ".jpg" is added before making the request to the server for the image.
We have come to a dead halt. Any suggestions?
This is how we originally planned to use it:
<img src="/ImgMgr?name=imgName">
We realized that the browser was expecting some extension. So we added JavaScript:
<img id="documentImage" src="/images/blankImage.jpg">
<script language="JavaScript">
document.getElementById("documentImage"
</script>
This all sounded good until we realized that the ".jpg" is added before making the request to the server for the image.
We have come to a dead halt. Any suggestions?