I am trying to show the image that I have took from my database, but when the page opens it doesn't show the image. I have taken the image from the database which is saved as a blob, turned into byte[] and then turned it into an image icon. Then sending it to the jsp via model.addAttribute. Here is the code where I am getting the blob and converting: This is my controller method
if(post.getImage() != null) {
Blob blob = post.getImage();
ImageIcon ii=new ImageIcon(blob.getBytes(1, (int) blob.length()),"description");
System.out.println("shalom " + ii);
model.addAttribute("img", ii);
}
And this is where I am trying to use the image
<img src="<c:out value="${img}"/>" width="100" height="100"></img>
If there's any ideas I would be very appreciative. Cheers Jim :)