That
sounds good. I guess I didn't really know what the img tag was for. It's not in
the documentation yet is it? Looking at the code I have a better idea of what
it's for but I think the page attribute would be good for consistency.
Thanks, Hal
-----Original Message-----"Deadman, Hal" wrote:
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: Re: is the img tag working?I am using the Struts html:img tag and I just moved my app from the root context to a different context. All the other Struts links I have seem to have prepended the context name in the link. The image tag didn't. Am I doing something wrong?this jsp:<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <html:img src="/image/odtos_logo.gif" alt=""/> generated:
<img src="/image/odtos_logo.gif" alt=""> when the context root in the application.xml of my ear file is: <context-root>odtos</context-root>shouldn't it generate:<img src="/odtos/image/odtos_logo.gif" alt="">Thanks, Hal
The "src" attribute of the <html:img> tag is essentially copied unchanged (other than URL encoding), which means you would want to use a relative path to be independent of the context path you are deployed under. This is consistent with the way that <html:link> treats the "href" attribute.However, the <html:link> tag also offers the "page" attribute, which lets you specify a context-relative path, and Struts will add the context path for you. How about if we add a "page" attribute to <html:img>, as an alternative to the "src" attribute, so you can have it either way?
Craig