You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by petra staub <ca...@hotmail.com> on 2002/08/26 11:55:09 UTC

Application Context Access

I dont understand the following:

I have a struts application, lets call it MyApp,
which actions call jsp pages under MyApp/WEB-INF/pages.
additionally, I have images stored in the root of my
application (MyApp/images).

Why cant I access the images in MyApp using the relative
path /images? If I do so in a jsp file (eg. MyApp/WEB-INF/
pages/home.jsp) forwarded from my action, the relative
directory /images is not known...I have to use /MyApp/images/.
>From a jsp in the root (e.g. MyApp/home.jsp) every works fine
with images accessed by /images.

Does anyone has a quick explanation for me? :)

thanks a lot!




_________________________________________________________________
Mit MSN Fotos können Sie kinderleicht Ihre Fotos ausdrucken und Freunden zur 
Verfügung stellen: http://photos.msn.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Application Context Access

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 26 Aug 2002, petra staub wrote:

> Date: Mon, 26 Aug 2002 11:55:09 +0200
> From: petra staub <ca...@hotmail.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Application Context Access
>
>
> I dont understand the following:
>
> I have a struts application, lets call it MyApp,
> which actions call jsp pages under MyApp/WEB-INF/pages.
> additionally, I have images stored in the root of my
> application (MyApp/images).
>
> Why cant I access the images in MyApp using the relative
> path /images? If I do so in a jsp file (eg. MyApp/WEB-INF/
> pages/home.jsp) forwarded from my action, the relative
> directory /images is not known...I have to use /MyApp/images/.
> >From a jsp in the root (e.g. MyApp/home.jsp) every works fine
> with images accessed by /images.
>
> Does anyone has a quick explanation for me? :)
>
> thanks a lot!

Relative paths starting with "/" are assumed to be relative to the server,
not the current directory.  Try:

  <img src="../../images/logo.gif">

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>