Where to put bean property files

2000-12-28 Thread John Pletka

I have a bean that I'm trying to use in a jsp page that requires a
.properties file to initialize itself.  It looks for the properties file in
the current directory (new FileInputStream("fileName.properties")).  I've
tried putting the file in the lib directory, the WEB-INF directory, the
META-INF directory, in the same directory as the .jsp file and even in the
jar file of the bean, but I always get "FileNotFound" exceptions.  Where is
the proper place to put configuration files?




RE: Where to put bean property files

2000-12-28 Thread Tony Wilson

The 'current working directory' for orion is wherever java is executed to
run orion.   This can be hidden by the admin utility, but you can check the
configuration files and attempt to locate the directory that way.

Try putting the .properties file in the directory parent to your server.xml
file.
i.e. if your server.xml were in /opt/orion/config, put your .properties file
in /opt/orion 

This can get ugly and confusing, if you get multiple '.properties'-like
files in that directory.  I would suggest having your code look for files in
a 'myconfig' or 'files' directory, and making that directory appear where
you start orion.

I hope this was clear.

Tony Wilson
-Original Message-
From:   John Pletka [mailto:[EMAIL PROTECTED]]
Sent:   Thursday, December 28, 2000 10:37 AM
To: Orion-Interest
Subject:Where to put bean property files

I have a bean that I'm trying to use in a jsp page that
requires a
.properties file to initialize itself.  It looks for the
properties file in
the current directory (new
FileInputStream("fileName.properties")).  I've
tried putting the file in the lib directory, the WEB-INF
directory, the
META-INF directory, in the same directory as the .jsp file
and even in the
jar file of the bean, but I always get "FileNotFound"
exceptions.  Where is
the proper place to put configuration files?




Re: Where to put bean property files

2000-12-28 Thread Christian Sell

I'd recommend putting it anywhere below the web application directory (the
one under which WEB-INF is located) and using
servletContext.getResourceAsStream(), e.g.
getResourceAsStream("/myfile.properties") if you put it into the wepapp root

- Original Message -
From: "John Pletka" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Thursday, December 28, 2000 7:36 PM
Subject: Where to put bean property files


 I have a bean that I'm trying to use in a jsp page that requires a
 .properties file to initialize itself.  It looks for the properties file
in
 the current directory (new FileInputStream("fileName.properties")).  I've
 tried putting the file in the lib directory, the WEB-INF directory, the
 META-INF directory, in the same directory as the .jsp file and even in the
 jar file of the bean, but I always get "FileNotFound" exceptions.  Where
is
 the proper place to put configuration files?






Re: Where to put bean property files

2000-12-28 Thread Jay Armstrong

Christian,

That's what I've been doing and it works fine, but I would love to hear
other suggestions.

Jay Armstrong
[EMAIL PROTECTED]

At 10:19 PM 12/28/00 +0100, you wrote:
I'd recommend putting it anywhere below the web application directory (the
one under which WEB-INF is located) and using
servletContext.getResourceAsStream(), e.g.
getResourceAsStream("/myfile.properties") if you put it into the wepapp root

- Original Message -
From: "John Pletka" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Thursday, December 28, 2000 7:36 PM
Subject: Where to put bean property files


 I have a bean that I'm trying to use in a jsp page that requires a
 .properties file to initialize itself.  It looks for the properties file
in
 the current directory (new FileInputStream("fileName.properties")).  I've
 tried putting the file in the lib directory, the WEB-INF directory, the
 META-INF directory, in the same directory as the .jsp file and even in the
 jar file of the bean, but I always get "FileNotFound" exceptions.  Where
is
 the proper place to put configuration files?