You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gogineni, Pratima" <pg...@selectica.com> on 2004/04/29 07:32:15 UTC

relative paths problem

Hi,

I have most of my html/jsp files in my webapp under the "docs" subfolder.
The images are in the "images" subfolder. 
I see some really strange behavior: IF I go to the JSP page inside the docs
folder through a html page it works fine. IF I go to the jSP page from an
action the images are not displayed since the relative path seems to be
resolved relative to the base folder instead of relative to the docs folder.

My application requires that I be able to reach this page from both a static
page as well as through a forward from an action. Is there some way of doing
this? currently if the image path is set to "../images/abc.jpg" it works
from the static page but not from the action class. images/abc.jpg works in
case of a forward from an action class but not from a static page.

Im hoping someone run into this problem before & knows of a solution.

Pratima



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


RE: relative paths problem

Posted by Andrew Hill <an...@gridnode.com>.
Probably the <html:base tag can help you here. (Its used to render a <base>
element to tell the browser where to start looking for things relative to
the page).

-----Original Message-----
From: Gogineni, Pratima [mailto:pgogineni@selectica.com]
Sent: Thursday, 29 April 2004 13:32
To: 'user@struts.apache.org'
Subject: relative paths problem


Hi,

I have most of my html/jsp files in my webapp under the "docs" subfolder.
The images are in the "images" subfolder.
I see some really strange behavior: IF I go to the JSP page inside the docs
folder through a html page it works fine. IF I go to the jSP page from an
action the images are not displayed since the relative path seems to be
resolved relative to the base folder instead of relative to the docs folder.

My application requires that I be able to reach this page from both a static
page as well as through a forward from an action. Is there some way of doing
this? currently if the image path is set to "../images/abc.jpg" it works
from the static page but not from the action class. images/abc.jpg works in
case of a forward from an action class but not from a static page.

Im hoping someone run into this problem before & knows of a solution.

Pratima



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



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