Reputation: 437
I have this code:
byte[] bytes = IOUtils.toByteArray(is);
response.setContentType("image/jpeg");
response.setContentLength(bytes.length);
response.getOutputStream().write(bytes);
When it runs the page that comes up is just a blank webpage with the image on top. How do I send this image to the JSP to use amongst the HTML?
Upvotes: 0
Views: 345
Reputation: 73528
Set the src tag to point to the servlet's url as in
<img src="/servlet/url/here"></img>
.
Upvotes: 2