|
sounds like a plan !
thanks simon.
Paul,
I suggest you create a thumbnail-cache which holds the image data for
thumbnails you create, with a unique, meaningful id for each one. This could
either purge any thumbnails older than say 5 minutes, or purge thumbnails
related to a specific session when the session is invalidated.
Then include the unique id in your img tag in the html you output and serve
the thumbnails directly from the servlet.
When the servlet receives a thumbnail request (e.g.
/www.something.com/servlets/youservlet?method=thumb&id=10349) you just
pull the image data out of the cache.
When creating thumbnails, always check if they already exist in the cache
first so that you can save work where possible - you also have to do the
equivalent of a 'touch' to stop your purging arrangement getting rid of them
before they are served!
- simon
Paul Lingwood wrote:
hi all, i've just written an imaging applet .... and a servlet
to handle updates and retrieval of blobs.The servlets
outputs these blobs by one of two methods1 : I output
the image straight to the browser (as content type "image/jpg") so that
the user sees a new HTML page with
only the image displayed. 2 : and this is the
problem .... when the servlet accepts image(s) .. i create a thumbnail for
each. Now ... how the hell do i
dynamically display these thumbnails from a sevlet with HTML .. (remembering
that the thumbnails are also blobs
retrieved from the DB) so i cant just link to them. If i extract the thumbnails to the server file
system .. and dynamically create the HTML with
the links .. i have no way of knowing
when the user is finished with that page .. and when i can delete
the thumbnails. Help on this would be gratefully appreciated. Thanks Paul
Lingwood
|