Justin's suggestion works, but personally I prefer using:
InputStream is =
getServletContext().getResourceAsStream("/WEB-INF/myresource");
"Steph Richardson" <steph@(protected)
news:CCEJLCOJKFBHFPKFNNABEEHKDDAA.steph@(protected)...
>
> I have a web-app that uses several xml, xsd, and other configuration files
at runtime ( including during the Application Init
> event ). We keep these files under various directories under WEB-INF so
that we can get their paths at runtime relative to
> ServletContext.getRealPath( "WEB-INF" ).
>
> When I am deploying this web-app as a war file, I can detect I am a war
file at runtime because ( getRealPath( "" ) == null ), but
> is there a consistent way to read a file from this war file ?
>
> Thanks
>
> --------------------------------------------------------
> Steph Richardson
> Kvasar Technology LLC
> HQ: suite 106, 822 Boylston st., Chestnut Hill, MA 02467
> smtp : steph@(protected)
> http : www.kvasar.com
> --------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)