Because your dealing with a database, you may want to try the
DownloadAction... it will deal with at least some of the details. IIRC,
somewhere on the Wiki is an example I wrote of using it specifically
returning an object from a database. II-DON'T-RC, ping me, I know I've
done it at some point.
Frank
Wendy Smoak wrote:
From: "C.F. Scheidecker Antunes" <[EMAIL PROTECTED]>
I am writing a Struts application which needs to read a database,
fetch an image inside a blob field and display it in a JSP page in two
different ways:
- Within a thumbnail size inside a column of a normal html <table>.
Which means the image needs to be resized for displaying purposes.
All images inside this table cannot exceed a maximum height and width
in order to have a neat display.
- And using the image original size.
When you put <img src="..."/> in an HTML page, the browser will make a
separate request to get the image. I would map that request to a plain
old Servlet-- there's no reason to tie this to the Struts framework.
I do this now for an image that's generated by JFreeChart, but the same
thing applies if you're going to retrieve binary data from a database
and write it out to the browser. Assuming you already know how to
retrieve the image from the database, ask Google about images and servlets:
http://www.google.com/search?q=java+image+servlet
I would get the full size image retrieval and display working first,
then think about how to do the thumbnails.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]