how do you store your image files in your DB? as BLOB objects or as references to image files at some location?
Ozgur. > -----Original Message----- > From: john-paul delaney [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 22, 2002 3:15 AM > To: Tomcat Users List > Subject: Re: Html/jpg from db to client? > > > On Mon, 22 Apr 2002, Nikola Milutinovic wrote: > > Thanks Nix... then I'm thinking I need three servlets to handle > for each page sent to the client... 1. Write the html header, 2. > Get image from db and send the image, 3.Add in dimensions to <img > tag> & add the footer. > > Is this correct? > > regards > /j-p. > > > If you wish to send BOTH html and the image in the same > invocation of the servlet, then you're mistaken. HTTP/HTML, in > general, doesn't work that way. You should make a servlet which > can retrieve a single picture, something like: > > > > /servlets/showImage?src=my_test_pic.gif > > > > Then make your servlet accept "src" parameter, retrive the > image from the database. Based on the extension you should set > the correct MIME type, in this case "image/gif" and send it. You > should set Response->contentType to your MIME type and open a > servlet output stream in the Response and just splash your image into it. > > > ----------------------- > JUSTATEST Art Online > www.justatest.com > > > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
