struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: taglib for locale-dependent logic to images?
Date Tue, 01 Aug 2006 15:52:15 GMT
On 8/1/06, Emmanouil Batsis <Emmanouil.Batsis@eurodyn.com> wrote:
>
> Suppose i have an images folder in my webapp with subfolders
> corresponding to locales:
>
> + WEB-INF
> + jsps
> + images
>    + default
>       + myImage.png
>    + fr
>       + myImage.png
>    + el
>       + myImage.png
>
> i'd like to do something like
>
> <foo:img imageFolder="images" image="myImage.png" />
>
> to render the image whose parent folder matches the user's locale if
> that folder does have a file named "myImage.png" or to try and get the
> image from the default locale/folder otherwise.
>
> Is there any taglib like that available anywhere?

You can do this with the current <html:img> tag - use either the
"pageKey" or "srcKey" attributes:

http://struts.apache.org/1.2.x/userGuide/struts-html.html#img

Niall


> Thanks in advance,
>
> Manos

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


Mime
View raw message