You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris <fl...@softhome.net> on 2004/07/14 12:21:01 UTC

Properties.getProperty() ignores character "\" in the value

Howdy,

Could someone please tell me why could this happen?

There is a  property file props including  a key-value pair "logfiledir=
c:\hwebgod"  , execute :

String logdir = props.getProperty("c:\logfiledir");

Then string logdir will be "c:logfiledir" ( the char \ is missing ! )

Any hint will be appreciated.
Zerol.


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


Re: why only put resource file to "$TC$\shared\classes", did TC found it?

Posted by Chris <fl...@softhome.net>.
Sorry for not enough info.

> what is 't' ?
"t" is a Javabeans (in package somepackage) which uses the resource file
"Application.properties"

----- Original Message ----- 
From: "Mike Curwen" <g_...@globallyboundless.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Wednesday, July 14, 2004 10:18 PM
Subject: RE: why only put resource file to "$TC$\shared\classes", did TC
found it?


> what is 't' ?
>
>
> > -----Original Message-----
> > From: Chris [mailto:flusspotomac@softhome.net]
> > Sent: Wednesday, July 14, 2004 6:24 AM
> > To: Tomcat Users List
> > Subject: why only put resource file to "$TC$\shared\classes",
> > did TC found it?
> >
> >
> > Howdy,
> > I am developing webapp using TC4.1.27 , Eclipse 3.0 and
> > Lomboz 3.0, In one of my webapp's bean class, I want to get a
> > resource file by :
> >
> > URL u = t.getClass().getResource("/Application.properties");
> >
> > my bean class  put to WEB-INF\classes\somepackage\,  and the
> > webapp was deployed by an xml file under directory
> > $TC$\webapps , It is strange the only put resource
> > file(Application.properties) to "$TC$\shared\classes", did TC
> > found it.
> >
> > I tried putting it to WEB-INF\classes,  it could not be
> > found. I tried putting it to WEB-INF\classes\somepackage,  it
> > could not be found. I tried putting it to Eclipse's project
> > directory,  it could not be found.
> >
> > Any idea?  Putting resource file to "$TC$\shared\classes"  is
> > a bad idea I think.:)
> >
> > Best Regards
> > Chris
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


RE: why only put resource file to "$TC$\shared\classes", did TC found it?

Posted by Mike Curwen <g_...@globallyboundless.com>.
what is 't' ?


> -----Original Message-----
> From: Chris [mailto:flusspotomac@softhome.net] 
> Sent: Wednesday, July 14, 2004 6:24 AM
> To: Tomcat Users List
> Subject: why only put resource file to "$TC$\shared\classes", 
> did TC found it?
> 
> 
> Howdy,
> I am developing webapp using TC4.1.27 , Eclipse 3.0 and 
> Lomboz 3.0, In one of my webapp's bean class, I want to get a 
> resource file by :
> 
> URL u = t.getClass().getResource("/Application.properties");
> 
> my bean class  put to WEB-INF\classes\somepackage\,  and the 
> webapp was deployed by an xml file under directory  
> $TC$\webapps , It is strange the only put resource 
> file(Application.properties) to "$TC$\shared\classes", did TC 
> found it.
> 
> I tried putting it to WEB-INF\classes,  it could not be 
> found. I tried putting it to WEB-INF\classes\somepackage,  it 
> could not be found. I tried putting it to Eclipse's project 
> directory,  it could not be found.
> 
> Any idea?  Putting resource file to "$TC$\shared\classes"  is 
> a bad idea I think.:)
> 
> Best Regards
> Chris
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


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


why only put resource file to "$TC$\shared\classes", did TC found it?

Posted by Chris <fl...@softhome.net>.
Howdy,
I am developing webapp using TC4.1.27 , Eclipse 3.0 and Lomboz 3.0,
In one of my webapp's bean class, I want to get a resource file by :

URL u = t.getClass().getResource("/Application.properties");

my bean class  put to WEB-INF\classes\somepackage\,  and the webapp
was deployed by an xml file under directory  $TC$\webapps , It is strange
the only put resource file(Application.properties) to "$TC$\shared\classes",
did TC found it.

I tried putting it to WEB-INF\classes,  it could not be found.
I tried putting it to WEB-INF\classes\somepackage,  it could not be found.
I tried putting it to Eclipse's project directory,  it could not be found.

Any idea?  Putting resource file to "$TC$\shared\classes"  is a bad idea
I think.:)

Best Regards
Chris


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


Re: Properties.getProperty() ignores character "\" in the value

Posted by Tim Funk <fu...@joedog.org>.
You need \\

-Tim

Chris wrote:

> Howdy,
> 
> Could someone please tell me why could this happen?
> 
> There is a  property file props including  a key-value pair "logfiledir=
> c:\hwebgod"  , execute :
> 
> String logdir = props.getProperty("c:\logfiledir");
> 
> Then string logdir will be "c:logfiledir" ( the char \ is missing ! )
> 

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