struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kornelis Sietsma <>
Subject html:img and nested:img problems
Date Mon, 07 Jul 2003 05:36:37 GMT
I am trying to write some images to a web page, where the image source comes from a

The only thing I can get to work reasonably is to use a raw html <image> tag, with
struts tags to write all the parameters - for example:  (note 'cell' is a bean with
various useful properties including a parameter map for the ShowImage servlet.
Eventually I'll use the nested tags for this, though there doesn't seem to be a
nested:rewrite tag...)

<image src="<html:rewrite page="/ShowImage" name="cell" property="displayParmMap"/>"
       width=<bean:write name="cell" property="width"/>
       height=<bean:write name="cell" property="height"/>
       alt="<bean:write name="cell" property="caption"/>"/>

Is there any way to do this with the html:img tag?  I can't seem to find any way to
do it.  It seems that the 'width', 'height', and 'alt' parameters are all unprocessed
by the tag, so there is no way to programmatically set them.

I also looked at the nested:img tag, but discovered a problem - it seems that
nested:img *requires* the 'name' property to be used, in which case it doesn't seem
to have any benefit over the base html:img tag.  (And it also doesn't seem to
interpret the 'width', 'height' or 'alt' parameters).

I guess my question is - is there any value at all to the html:img tag?  Especially
the 'width' and 'height' properties?  In what situation would you want to hard-code
an image width and height, and yet get the image URL from elsewhere?

Or is there something I'm missing?  :)

- Korny
Kornelis Sietsma
goofey: korny  yahoo: kornysietsma  icq: 2039172 ph: 0421 079 693

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message