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 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase?
Date Mon, 06 Aug 2012 19:40:24 GMT
> From: Miguel Almeida [mailto:migueldealmeida@gmail.com] 
> Subject: [Tomcat 7] Why can't you use automatic deployment 
> and exploded WAR when docBase is outside appBase?

> The motivation for this is a simple code ServletContext.getRealPath("/") 
> to create a simple temporary inputstream that works in Tomcat6 but doesn't 
> in Tomcat7 (because getRealPath("/") will return null).

And, if you check the servlet spec, getRealPath() is *never* guaranteed to work.  Your code
should be using either getResourceAsStream() or looking at the javax.servlet.context.tempdir
context attribute to find where it can create temporary files.

 - 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