You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Harvey <Da...@exegesys.com> on 2003/05/19 19:24:06 UTC

please help: loading images specified outside of the webapps directory hierarchy

Hello all, 
I have a problem using tomcat on Linux where an input tag specifies an image outside of the tomcat webapps directory.  

I am using Tomcat-4.1.24 on Linux RH 7.3.  Tomcat seems to be operating correctly, all of the sample servlet and jsp code works fine.  

The problems is the following tag in my html:
<input type="image" src="/home/knight/testprojects/eRPWeb6//Images/./Navigation/RevPurchaseOrderActivity.gif"
>

The problem is the images do not get sent to the browser.  I have turned on debugging on the default servlet in web.xml and I see the following message in: localhost_log.2003-05-19.txt

2003-05-19 11:01:41 default: DefaultServlet.serveResource:  Serving resource '/home/knight/testprojects/eRPWeb6/Images/Navigation/RevPurchaseOrderActivity.gif'
headers and data

I don't think this is a file permissions issue, the user that is running Tomcat (i.e. the user that executes ${TOMCAT_HOME}/bin/startup.sh) is the owner of the images.  Tomcat seems to open and read the file appropriately as shown from the above messages.  

If I put the images in the directory hierarchy where the web application is deployed (and change the input tag in the html) it works fine, so I don't think there is a problem with tomcat serving images.  

Tomcat running on windows has no problem serving images from outside of the webapps directory.  

Any ideas?  This is really been an irritating problem.  

Regards, D.  




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


Re: please help: loading images specified outside of the webapps directory hierarchy

Posted by Ben Souther <bs...@fwdco.com>.
Webapps shouldn't be able to serve up images outside of the webapps directory.

If it's working on Windows, it's because you're running the browser on the 
same machine that is running Tomcat.  It wouldn't work over the web.

Put the images in a directory within your webapp.



On Monday 19 May 2003 01:24 pm, David Harvey wrote:
> Hello all,
> I have a problem using tomcat on Linux where an input tag specifies an
> image outside of the tomcat webapps directory.
>
> I am using Tomcat-4.1.24 on Linux RH 7.3.  Tomcat seems to be operating
> correctly, all of the sample servlet and jsp code works fine.
>
> The problems is the following tag in my html:
> <input type="image"
> src="/home/knight/testprojects/eRPWeb6//Images/./Navigation/RevPurchaseOrde
>rActivity.gif"
>
>
> The problem is the images do not get sent to the browser.  I have turned on
> debugging on the default servlet in web.xml and I see the following message
> in: localhost_log.2003-05-19.txt
>
> 2003-05-19 11:01:41 default: DefaultServlet.serveResource:  Serving
> resource
> '/home/knight/testprojects/eRPWeb6/Images/Navigation/RevPurchaseOrderActivi
>ty.gif' headers and data
>
> I don't think this is a file permissions issue, the user that is running
> Tomcat (i.e. the user that executes ${TOMCAT_HOME}/bin/startup.sh) is the
> owner of the images.  Tomcat seems to open and read the file appropriately
> as shown from the above messages.
>
> If I put the images in the directory hierarchy where the web application is
> deployed (and change the input tag in the html) it works fine, so I don't
> think there is a problem with tomcat serving images.
>
> Tomcat running on windows has no problem serving images from outside of the
> webapps directory.
>
> Any ideas?  This is really been an irritating problem.
>
> Regards, D.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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