You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Cook <ji...@iname.com> on 2000/06/23 14:22:51 UTC
Classloader and StringManager classes
My servlet makes use of the org.apache.tomcat.util.StringManager class to
load string resources from a properties file. Unfortunately, this class
throws an exception when loading the properties file in my servlet. The
LocalStrings.properties file is in the appropriate directory relative to my
classes.
Am I experiencing a classloader issue here? Is anyone using StringManager in
their servlets?
thanks,
jim
Re: Classloader and StringManager classes
Posted by James Cook <ji...@iname.com>.
sorry...fsdv?
----- Original Message -----
From: Cheen Qian <cq...@packeteer.com>
> fsdv
Re: Classloader and StringManager classes
Posted by Cheen Qian <cq...@packeteer.com>.
fsdv
James Cook wrote:
>
> Thanks,
>
> To make this work in Tomcat, I guess I would have to extend StringManager to
> use the getResourceAsStream method? I don't have an absolute filename. Is
> this absolutely necessary...is anyone succesfully using StringManager in
> their servlets?
>
> jim
>
> ----- Original Message -----
> From: Fred Esch <fe...@ecologic.net>
> To: <to...@jakarta.apache.org>
> Sent: Friday, June 23, 2000 3:17 PM
> Subject: Re: Classloader and StringManager classes
>
> > Try something like this, it works for me.
> >
> > URL url = new URL(fileName);
> > InputStream in = url.openStream();
> > Properties p = new Properties();
> > p.load(in);
> >
> >
> > James Cook wrote:
> >
> > > My servlet makes use of the org.apache.tomcat.util.StringManager class
> to
> > > load string resources from a properties file. Unfortunately, this class
> > > throws an exception when loading the properties file in my servlet. The
> > > LocalStrings.properties file is in the appropriate directory relative to
> my
> > > classes.
> > >
> > > Am I experiencing a classloader issue here? Is anyone using
> StringManager in
> > > their servlets?
> > >
> > > thanks,
> > > jim
> > >
> >
> > --------------------------------------------------------------------------
> > > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> >
> > --
> > Fred Esch
> > ____________________________________________________
> >
> > E C O l o g i c C o r p o r a t i o n
> > http://www.ecologic.net
> >
> > fesch@ecologic.net
> > 19 Eye Street, N.W.
> > Washington, DC 20001
> >
> > v. 202.218.4100
> > f. 202.842.5088
> >
> > Object-Relational Software Engineering and Systems Integration
> >
> >
> >
> > --------------------------------------------------------------------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> >
> >
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
Re: Classloader and StringManager classes
Posted by James Cook <ji...@iname.com>.
Thanks,
To make this work in Tomcat, I guess I would have to extend StringManager to
use the getResourceAsStream method? I don't have an absolute filename. Is
this absolutely necessary...is anyone succesfully using StringManager in
their servlets?
jim
----- Original Message -----
From: Fred Esch <fe...@ecologic.net>
To: <to...@jakarta.apache.org>
Sent: Friday, June 23, 2000 3:17 PM
Subject: Re: Classloader and StringManager classes
> Try something like this, it works for me.
>
> URL url = new URL(fileName);
> InputStream in = url.openStream();
> Properties p = new Properties();
> p.load(in);
>
>
> James Cook wrote:
>
> > My servlet makes use of the org.apache.tomcat.util.StringManager class
to
> > load string resources from a properties file. Unfortunately, this class
> > throws an exception when loading the properties file in my servlet. The
> > LocalStrings.properties file is in the appropriate directory relative to
my
> > classes.
> >
> > Am I experiencing a classloader issue here? Is anyone using
StringManager in
> > their servlets?
> >
> > thanks,
> > jim
> >
>
> --------------------------------------------------------------------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
> --
> Fred Esch
> ____________________________________________________
>
> E C O l o g i c C o r p o r a t i o n
> http://www.ecologic.net
>
> fesch@ecologic.net
> 19 Eye Street, N.W.
> Washington, DC 20001
>
> v. 202.218.4100
> f. 202.842.5088
>
> Object-Relational Software Engineering and Systems Integration
>
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
>
Re: Classloader and StringManager classes
Posted by Fred Esch <fe...@ecologic.net>.
Try something like this, it works for me.
URL url = new URL(fileName);
InputStream in = url.openStream();
Properties p = new Properties();
p.load(in);
James Cook wrote:
> My servlet makes use of the org.apache.tomcat.util.StringManager class to
> load string resources from a properties file. Unfortunately, this class
> throws an exception when loading the properties file in my servlet. The
> LocalStrings.properties file is in the appropriate directory relative to my
> classes.
>
> Am I experiencing a classloader issue here? Is anyone using StringManager in
> their servlets?
>
> thanks,
> jim
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
--
Fred Esch
____________________________________________________
E C O l o g i c C o r p o r a t i o n
http://www.ecologic.net
fesch@ecologic.net
19 Eye Street, N.W.
Washington, DC 20001
v. 202.218.4100
f. 202.842.5088
Object-Relational Software Engineering and Systems Integration