You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gentyjp <ge...@libertysurf.fr> on 2003/12/19 11:04:45 UTC

Dynamic html:image


     Hi

  Struts and tags newbie again !!

  I have a string vector of image name.
I wish to view them using html:image.

My question is how can I initialize my page attribute ?


         <logic:iterate id="item" name="imageList" >
           <html:image  page="put here the value of my iterator" >
         </logic:iterate>

  Thanks

   Jean-Paul


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


Re: Dynamic html:image

Posted by gentyjp <ge...@libertysurf.fr>.
At 11:37 19/12/2003, you wrote:
>Assuming imageList contains String taht are absolute (in application 
>context) path to your images, this should work :
>
><logic:iterate id="item" name="imageList" >
>     <html:image  page="<%= item %>" >
></logic:iterate>

   It works, except I had to do  item.toString()

  Thanks a lot

  Jean-Paul 


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


Re: Dynamic html:image

Posted by Mark Lowe <ma...@talk21.com>.
Same as nico really but you might like the el option

<html-el:img page="${item}" />

i'd have the image as a bean with a path, name and desc properties

<html-el:img page="${item.path}"
	imageName="${item.name}"
	alt="${item.desc}" />

Cheers Mark


On 19 Dec 2003, at 10:37, Nicolas De Loof wrote:

> Assuming imageList contains String taht are absolute (in application 
> context) path to your images, this should work :
>
> <logic:iterate id="item" name="imageList" >
>     <html:image  page="<%= item %>" >
> </logic:iterate>
>
>
> Nico.
>
> ----- Original Message -----
> From: "gentyjp" <ge...@libertysurf.fr>
> To: <st...@jakarta.apache.org>
> Sent: Friday, December 19, 2003 11:04 AM
> Subject: Dynamic html:image
>
>
>>
>>
>>      Hi
>>
>>   Struts and tags newbie again !!
>>
>>   I have a string vector of image name.
>> I wish to view them using html:image.
>>
>> My question is how can I initialize my page attribute ?
>>
>>
>>          <logic:iterate id="item" name="imageList" >
>>            <html:image  page="put here the value of my iterator" >
>>          </logic:iterate>
>>
>>   Thanks
>>
>>    Jean-Paul
>>
>>
>> ---------------------------------------------------------------------
>> 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
>


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


Re: Dynamic html:image

Posted by Nicolas De Loof <ni...@cgey.com>.
Assuming imageList contains String taht are absolute (in application context) path to your images, this should work :

<logic:iterate id="item" name="imageList" >
    <html:image  page="<%= item %>" >
</logic:iterate>


Nico.

----- Original Message ----- 
From: "gentyjp" <ge...@libertysurf.fr>
To: <st...@jakarta.apache.org>
Sent: Friday, December 19, 2003 11:04 AM
Subject: Dynamic html:image 


> 
> 
>      Hi
> 
>   Struts and tags newbie again !!
> 
>   I have a string vector of image name.
> I wish to view them using html:image.
> 
> My question is how can I initialize my page attribute ?
> 
> 
>          <logic:iterate id="item" name="imageList" >
>            <html:image  page="put here the value of my iterator" >
>          </logic:iterate>
> 
>   Thanks
> 
>    Jean-Paul
> 
> 
> ---------------------------------------------------------------------
> 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