Re: property files or similar

2001-05-03 Thread Holden Glova

elephantwalker wrote:
> 
> You can set the env properties for the application in the deployment
> descripter xml file. This allows you to pass parameters to the
> application...for example, your properties path.
> 
> OR more recklessly, you could pass the information you are pulling out of
> your properties in your env, and bury the properties thingy once and for
> all.
> 
> regards,
> 
> the elephantwalker

Thanks to both elephantwalker and
Sirkanth Bellalacheruvu for their
suggestions, we have decided to go with
the env settings in the web.xml.

Thanks again for the knowledge.
-- 
Holden Glova, [EMAIL PROTECTED]
Software Engineer
Alchemy Group Limited
Level 6 Royal Sun Alliance Bldg
PO Box 2386
Christchurch
New Zealand
Phone: +64 3 962-0396
Fax: +64 3 962-0388




Re: property files or similar

2001-05-03 Thread Srikanth Bellalacheruvu

Hi,

You can continue to use properties file, and here's an alternative to
hardcoding the file system path in your app.

First create a jar within which your properties file exists. For example, if
your property file is called props.ini you could put it with the path
"com/foo/props.ini" within some jar, say "comfoo.jar".

Place comfoo.jar in {ORIONHOME}/lib folder. You can bypass problems with
classpath settings by placing your jar file here.

Then, in your application where you use the properties file, get the
classloader and you can get the properties file as a resource. The following
code might be useful.

/* - */

Properties props = new Properties();
ClassLoader clsLdr = .getClass().getClassLoader();
InputStream instr = clsLdr.getResourceAsStream("com/foo/props.ini");

props.load(instr);

/* - */

HTH,

-Srikanth

-
Srikanth B.
Wipro Technologies,
Bangalore, India.
Email - [EMAIL PROTECTED]
http://www.wipro.com/ - Applying Thought

- Original Message -
From: Holden Glova <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 6:11 AM
Subject: property files or similar


> Hello,
>
> Aside from hardcoding a path to the
> properties file we are using, is there
> anywhere you specify these types of
> resources to orion instead of hardcoded
> in a class?
>
> What would be the alternative to using
> something like a property file, given
> that a property file is *very* easy to
> use?
>
> Many thanks in advance for your inputs.
>
> --
> Holden Glova, [EMAIL PROTECTED]
> Software Engineer
> Alchemy Group Limited
> Level 6 Royal Sun Alliance Bldg
> PO Box 2386
> Christchurch
> New Zealand
> Phone: +64 3 962-0396
> Fax: +64 3 962-0388
>





RE: property files or similar

2001-05-02 Thread elephantwalker

You can set the env properties for the application in the deployment
descripter xml file. This allows you to pass parameters to the
application...for example, your properties path.

OR more recklessly, you could pass the information you are pulling out of
your properties in your env, and bury the properties thingy once and for
all.

regards,

the elephantwalker


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Holden Glova
Sent: Wednesday, May 02, 2001 5:42 PM
To: Orion-Interest
Subject: property files or similar


Hello,

Aside from hardcoding a path to the
properties file we are using, is there
anywhere you specify these types of
resources to orion instead of hardcoded
in a class?

What would be the alternative to using
something like a property file, given
that a property file is *very* easy to
use?

Many thanks in advance for your inputs.

--
Holden Glova, [EMAIL PROTECTED]
Software Engineer
Alchemy Group Limited
Level 6 Royal Sun Alliance Bldg
PO Box 2386
Christchurch
New Zealand
Phone: +64 3 962-0396
Fax: +64 3 962-0388





property files or similar

2001-05-02 Thread Holden Glova

Hello,

Aside from hardcoding a path to the
properties file we are using, is there
anywhere you specify these types of
resources to orion instead of hardcoded
in a class?

What would be the alternative to using
something like a property file, given
that a property file is *very* easy to
use?

Many thanks in advance for your inputs.

-- 
Holden Glova, [EMAIL PROTECTED]
Software Engineer
Alchemy Group Limited
Level 6 Royal Sun Alliance Bldg
PO Box 2386
Christchurch
New Zealand
Phone: +64 3 962-0396
Fax: +64 3 962-0388