tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Esteban González <egonza...@outside.com.ar>
Subject Re: Tomcat 4.0.3 & getResourceAsStream
Date Mon, 02 Dec 2002 15:59:28 GMT
Thanks for your help andreas.

It didn´t work with p.getClass..

i´m trying with getServletContext().

But my idea is to have WEB-INF/conf   to place all .properties files.

is that possible?...

Best regards,
Esteban

----- Original Message -----
From: "Andreas Probst" <andpro77@gmx.net>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Monday, December 02, 2002 12:57 PM
Subject: Re: Tomcat 4.0.3 & getResourceAsStream


Hi Esteban,

try

p.getClass().getResourceAsStream("/WEB-INF/icard.properties");
(inside WEB-INF)
or
p.getClass().getResourceAsStream("/WEB-
INF/classes/icard.properties");
(inside classes)
or
p.getClass().getResourceAsStream("/WEB-
INF/lib/icard.properties");
(inside lib)

If this doesn't work, try
getServletContext().getResourceAsStream(...)
This one will work.

Good luck.

Andreas

On 2 Dec 2002 at 12:33, Esteban González wrote:

> Hi!
> I´ve just moved an old app that we had running using Jserv to
> tomcat4.0.3
>
> But i have problems with this
>     p = new Properties();
>     InputStream is =
>     p.getClass().getResourceAsStream("/icard.properties");
> I keep getting null no matter where i put the icard.properties
> file.
>
> i´ve placed icard.properties inside WEB-INF/lib and
> WEB-INF/classes and it´s also on the classpath...
>
> any workarounds to this issue?...  I´m trying not to use the
> java.io.* approach...
>
> ----------------------------------
> Esteban González
>
> Departamento de Sistemas
> ASSIST-CARD International
>
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org> For
> additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message