This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am using an api in a web app to return a byte array of an image stored in a database. I have tried dumping the byte array into the response but the browser does not display it. Believe the image is a tiff so I also tried downloading the tiff browser plugin. Still does not work.
Most browsers don't display tiff without the aid of plugins. You might want to test with the browsers you plan to support by trying to serve up a static tiff file using a plain old <img /> tag before going too far with this..
In our CodeBarn, in the servlets section, there is a sample app, packaged in a war file that streams images to browsers. Look for SimpleStream. In that app, the images are read from disk using context.getResourceAsStream. You'll need to modify it to serve up your byte array or, (if your library can serve one) a stream. It should be enough to get you going though.