I need to read a image from the database and display it as part of the jsp.The jsp has other parts - text,etc.
The architecture of my application uses struts,delegate pattern,servie pattern and then dao pattern.
i am reading the image using CachedRowSet and having it as a BufferedImage object.
But I wish to know how i can display the image onto the jsp page.
Now,the problem is that it is not the only content.
Need to display a logo.
Once you've got the inputStream (whether from a file or a db read) the code for streaming it to the browser is the same.
http://simple.souther.us Look for SimpleStream.
Originally posted by pankaj patil:
when u upload an image file, u have to store the image in the database datatype(image). then while displaying the u hve to take the data from the database in the bytearray. Create a new file and write bytearray into the new file save the file as rowno or any thing else . and then make use of the <img src=" path where the file is stored " > tag .
So, you're writing the image to disk every time someone wants to view it?
Why not just stream it right from the database to the browser?
I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.
Please read this for more information.