tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Logo file location
Date Mon, 14 Dec 2009 21:48:43 GMT
Caldarale, Charles R wrote:
>> From: André Warnier []
>> Subject: Re: Logo file location
>> Upon further examination of the spec page above, I would guess that a
>> better way (more flexible) would be to specify the relative URI of your
>> file as an <init-param> value, and then do a getRealPath() to convert
>> that into a real path
> No, no, no - there is *never* any guarantee that getRealPath() will return anything.
 (Personally, I think it should be deprecated; it's bloody dangerous.)  Use getResourceAsStream(),
as previously suggested.  Using <init-param> is certainly a good idea if you don't want
to hard-code the path in the servlet code.
I don't want to hijack the OP's thread any further, so I'll leave it at 
that, and start a new one on this (resource file location).

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message