[SNIP]

>> chris S>>> getRealPath is a bad idea. <<<
>> 
>> For my education's sake, would you please explain that?  [SNIP]
>
> There is no guarantee it will return a non-null value. The typical reason
> is if the app is running from a packed WAR. Using it reduces the portability
> of your application.
>
> Mark

Thanks for explaining that.  Never occurred to me that running from a WAR would 
return null.

I used getRealPath thinking it would *increase* portability, since 
yet-another-config-option would not need to be manually set (or verified) after 
every deployment or in a different environment.  "Why did the such-and-so fail? 
 Oh... I forgot to set the folder location - again."  By using getRealPath the 
setting never, ever needs to be configured - it's automatic.

But now I may need to rethink that.

BTW, why doesn't getRealPath return the full path to the folder that the WAR 
file is in instead of null?

--
Cris Berneburg
CACI Lead Software Engineer


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

Reply via email to