Using the expression language, you can build paths like this:
<html:img src="${somePath}/images/foo.jpg"/>
The "somePath" variable could be an application scope attribute (ServletContext attribute). I have done this before by writing a (Struts) plugin that gets "somePath" from web.xml (init-param) and stores it as a ServletContext attribute. Then it's availabe (as shown above) in all tags in all your JSPs.
Not sure if there is a better way but that works. You can change your image URL prefix simply by editing web.xml.
Erik
Gaet wrote:
Hello,
I'm writting a web application using J2EE where several pages can contains the same images. I would like to have the path to these images into one place an if possible into the same place for all images. For instance in a file and have a tag to access like this <html:img alias="dog">
like this I can move my images from one folder to another, I will have only one file to update....
Does somebody use something similar?
TIA
Gaet
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]