vijay wrote:
I actually have a jsp page where I am displaying the
"Product details", like the product name, its cost and
various other information about the product. Along
with it, I also have to display the picture of the
product.

I am passing the product_id in the query string. From
this, I get all the information about the product and
I am also able to display them except the picture.

I am storing the picture's filename
(jakarta-power.gif) rather than the picture itself in
the database. So I get a String from the form bean.

public String getPictureName()
public void setPictureName(String)

I just need to append the filename that I get to the
src attribute of html:img.

<html:img src="/out/pictureNameSHOULD_COME_HERE" />

I am not able to get this using the various param*
attributes in html:img. I am using the <bean:write> to
display the product details in the jsp page.

What do the param* attributes have to do with it? Do you need query parameters as part of the img URL? From what you show above it doesn't look like it. Have you tried this:

    <html:img src="/out/${YourForm.pictureName}"/>

or, if you don't have JSTL available,

    <html:img src="<%= "/out/" + YourForm.getPictureName() %>"/>

Note that the 'src' attribute passes its value through to the generated HTML page unmodified, so the above will only work if your webapp is deployed as the root context (i.e. if '/out/...' is really the correct absolute path to the image). You may want to use 'page' instead of 'src' to make sure your image is correctly referenced when the webapp isn't deployed as the root context too (i.e. when the real URL is something like '/myapp/out/...').

If this doesn't work, please post your ActionForm source and the relevant parts of your JSP and struts-config.xml.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to