tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Tomcat 6: How to tell a Context/Webapp where to look for files?
Date Tue, 03 Feb 2009 22:42:13 GMT
> From: Steve Mysterious [mailto:tinker123@gmail.com]
> Subject: Tomcat 6: How to tell a Context/Webapp where to look
> for files?
>
> I noticed that if I don't give my JSPs and my servlet a
> path that they look for files in CATALINA_HOME

You should probably be using ServletContext.getResourceAsStream(), or possibly ClassLoader.getResourceAsStream().
 Note that using ServletContext.getRealPath() can be problematic, since the container (Tomcat)
is under no obligation to expose the file system (if any) to servlets.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

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


Mime
View raw message