struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todor Sergueev Petkov <t.s.pet...@basalmed.uio.no>
Subject Re: STRUTS - Image/Img tags - Thanks
Date Tue, 11 Nov 2003 07:32:19 GMT
Thanks for the reply.

Todor

Max Cooper wrote:
> The answer is yes, but not in the way you are thinking.
> 
> You cannot send a stream of HTML and image data together and expect the
> browser to display it. You can send a stream of HTML data with references to
> image data (<IMG> tags) and the browser will make a separate request for
> each of the images.
> 
> So, you need to develop an Action that can serve your image data from the
> database back to the browser. And then create <IMG> tags in your HTML files
> where the SRC attribute requests the right images.
> 
> For instance, if you implemented a showImage.do action that takes a
> resourceId parameter, you can write out <IMG> tags like this in your HTML:
> 
> <img src="/contextPath/showImage.do&resourceId=2258" alt="">
> 
> The <html:img> tag offers some help:
> 
> <html:img page="/showImage.do&resourceId=2258" alt=""/>
> 
> (There might be some support to write out the resourceId part with
> attributes like this: id="resourceId" name="beanWithResourceIdProperty"
> property="resourceIdProperty", but you can look that up in the docs for
> html:img -- I don't remember if that works or not.)
> 
> And then implement an action to serve the images. This discussion comes up
> on this list periodically, and the archive for this mailing list has enough
> code and information to understand the issues (caching is one -- Craig
> McClanahan had a really good reply about this to one of my messages in the
> past month or two) and implement a good solution.
> 
> -Max
> 
> 
> ----- Original Message ----- 
> From: "Todor Sergueev Petkov" <t.s.petkov@basalmed.uio.no>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Monday, November 10, 2003 7:15 AM
> Subject: STRUTS - Image/Img tags
> 
> 
> 
>>Hello everybody, is there a way to use struts Image or Img tags to
>>display thumbnails ( pictures - gif or tiff or jpeg ) on a page from a
>>Stream and not from file. The idea is to pick the picts up directly from
>>a database and display them together with text on the same page?
>>
>>Thanks, Todor
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> .
> 

-- 
Todor Sergueev Petkov
---------------------------------------------
Center for Molecular Biology and Neuroscience
University of Oslo - Norway

t.s.petkov@basalmed.uio.no


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message