dcsimg
composing html:img SRC attribute by using a bean properties which bean is a item i a collection which im iterating on it
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Legolas_Woodland
Posted On:   Thursday, August 4, 2005 06:49 AM

I showld show an image by using something like this :

code:


+".jpg">


what this tag mean ? as i write it probably very poor : it means
I want to load an image , its source is a JPG file located in prodPics directory in my webContent
image name is same as nid of my bean (which im iterating over a collection of that bean.)

Now how should i use Tags , scriptlet or any other tricks to load my image file ?


Thank you.

Re: composing html:img SRC attribute by using a bean properties which bean is a item i a collection which im iterating on it

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, August 4, 2005 07:49 PM

try either JSTL to generate the value of your "src" attribute, or, if you might have to run in older environments, a "jsp expression" e.g.



html:img src='<%="prodPics/" + prod.getNid() + ".jpg" %>'



(if "prod" is not accessible as a local scripting variable, then do e.g.



((CastToYourProdType)request.getAttribute("prod")).getNid()
About | Sitemap | Contact