I think that <bean:define>  does what you want.

<bean:define id="altTxt" property="someImage.alt.text"/>
<html:img src="someImage.png" alt="<%= altTxt %>"/>

HTH,
    Pete

Howard Moore wrote:

> Can anybody suggest how I can add internationalised alt text to the
> <html:img> tag?
>
> If it were legal I would like to do something like the following;
>
> <html:img src="someImage.png" alt="<bean:message
> key='someImage.alt.text'/>"/>
>
> but you can't nest tags like this.
>
> If not does anybody think it would be useful to add an optional 'id'
> attribute to the <bean:message> tag which, if set, causes the translated
> message to be stored in a page context bean with the given name rather than
> being written out? This would allow me to write something like;
>
> <bean:message id="altTxt" key="someImage.alt.text"/>
> <html:img src="someImage.png" alt="<%= altTxt %>"/>
>
> It would also allow translated strings to be cached in the page if they are
> going to be used repeatedly (inside a <logic:iterate> tag, for example).
> This may improve performance considerably.
>
> Any comments?
>
> -------------------------------------------
> Howard Moore
> Senior Software Engineer
> Datapulse CTI
> Tel : +44 (0)1491 418000
> Fax : +44 (0)1491 411459
> E-mail: [EMAIL PROTECTED]
begin:vcard 
n:;
x-mozilla-html:FALSE
org:<BR><IMG SRC="http://www.irista.com/logo/irista.gif"><BR><BR><FONT Color=#000080><FONT SIZE=2><B>Bringing Vision to Your Supply Chain
adr:;;;;;;
version:2.1
end:vcard

Reply via email to