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: deploying a war file and starting the application
Date Fri, 28 Jan 2011 20:54:41 GMT
> From: Robert.Jenkin@surecomp.com [mailto:Robert.Jenkin@surecomp.com] 
> Subject: RE: deploying a war file and starting the application

> I make reference to getRealPath to load a property file.

It's definitely a bad thing to do.  You should be using ServletContext#getResourceAsStream().
 That will let your code avoid the assumption that there even is an underlying file system
(nothing in the servlet spec requires it), or, if it exists, that the container will allow
you to access the file system (the servlet spec only requires that the container provide access
to a temporary work area).

 - 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.

Mime
View raw message