Vikrama Sanjeeva wrote:
Hi,
I've "img.gif" and and "myForm.jsp" in same folder. But when I call the "
img.gif" with following path, it does not display in myForm.jsp. here it is:
<html:text property="date" ></html:text>
<img src="img.gif" id="f_trigger_c"
style="cursor: pointer; border: 1px solid red;" title="Date selector"
onmouseover="this.style.background='red';" onmouseout="
this.style.background=''" />
But when I call with src="../img.gif", it works. Here it is:
<html:text property="date" ></html:text>
<img src="../img.gif" id="f_trigger_c"
style="cursor: pointer; border: 1px solid red;" title="Date selector"
onmouseover="this.style.background='red';" onmouseout="
this.style.background=''" />
Why it so? Some url related problem?
How do you reference your JSP? If you're calling an action which
forwards to the JSP page, the browser doesn't know the physical location
of the JSP and will resolve relative URLs with respect to the action
path, not the JSP path.
You might want to look at the html:base tag [1] to help with this; it
allows you to tell the browser what base path to use for resolving
relative URLs in the page.
L.
[1]
http://struts.apache.org//struts-doc-1.2.8/userGuide/struts-html.html#base
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]