On Fri, 14 Sep 2001, Thierry Cools wrote:
> Date: Fri, 14 Sep 2001 15:38:33 +0200
> From: Thierry Cools <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: <html:img question
>
> Hi, after a long absence, I'm back again in the struts world ;-)
>
> I have the following problem, I'd like to add an image on my page,
> where the name of this image is stored in the database ( not the image
> itself, just the pathlocation and the name); So I've a form bean with
> a 'getImagePath()' method that returns a String.
>
> But the name & property attributes in the img tag are already reserved for multiple
>parameters,
> so, the question is, how can I get my Image coming from my get method, without using
>scriptlets and all that stuff ?
>
> Thanks for your help,
> Thierry
Hello Thierry,
Welcome back!
If your need is to display a different image depending on the user's
Locale, this can be satisfied with the "pageKey" or "srcKey" attribute:
<html:img pageKey="image.key" .../>
which looks up "image.key" in the application resources for the user's
current Locale. If you need something more generalized (such as images
that are personalized per user, independent of Locale), a runtime
exression might be your best bet:
<img src="<%= bean.getImagePath() %>">
Craig McClanahan