Rapthor wrote:
Donald McLean wrote:
Really? That sounds like a case of "The cure is worse than the disease."
I can't imagine a single case where something like that would be a
better solution than the three or four techniques for providing static
attributes that I'm already familiar with.
Keith Hatton wrote:
Two more robust solutions spring to mind:
1. You can use Properties.getProperty(String,String) to prevent your
NPE. The first string is the property name, the second is a default
value to be used when the property is not present.
http://java.sun.com/j2se/1.5.0/docs/api/java/u
2007 21:42
To: user@ant.apache.org
Subject: Re: ANT task to process properties-files into static class
Scot P. Floess wrote:
>
> If a property does not exist, why is a null pointer thrown? I assume
> you mean java.util.Properties? If so, that does not raise a null
> pointer except
If that's the sort of thing you're after, Log4J has a similar mechanism
which can monitor the config file and polls to see if it needs to reload
the configuration. [1]
I think that would provide a template for you. YMMV.
Cheers,
James
[1]
http://logging.apache.org/log4j/docs/api/org/apache/
It seems a trivial task to generate a Java source file from a property
with .
- Alexey.
Rapthor wrote:
Sorry, having confused you.
I have a file named global.properties. This file is edited manually by me.
The webapplication loads this file into a java.util.Properties-instance at
start.
Eve
Sorry, having confused you.
I have a file named global.properties. This file is edited manually by me.
The webapplication loads this file into a java.util.Properties-instance at
start.
Everywhere I use this Properties instance like "props.getProperty("myProp")"
I have to check whether a "null" i
Sorry, I'm not sure I follow your problem... Do you mean Ant should
somehow generate a properties file based upon your build.xml
properties? Who sets the properties and how is this null pointer being
raised? I am a "wee" bit confused ;)
Rapthor wrote:
Scot P. Floess wrote:
If a property
Rapthor wrote:
>
>
> Donald McLean wrote:
>>
>> Really? That sounds like a case of "The cure is worse than the disease."
>>
>> I can't imagine a single case where something like that would be a
>> better solution than the three or four techniques for providing static
>> attributes that I'm
Scot P. Floess wrote:
>
> If a property does not exist, why is a null pointer thrown? I assume
> you mean java.util.Properties? If so, that does not raise a null
> pointer exception.
>
You are right ... the NullPointerException would be thrown if I relied on a
value read from the Propertie
Donald McLean wrote:
>
> Really? That sounds like a case of "The cure is worse than the disease."
>
> I can't imagine a single case where something like that would be a
> better solution than the three or four techniques for providing static
> attributes that I'm already familiar with.
>
> H
Really? That sounds like a case of "The cure is worse than the disease."
I can't imagine a single case where something like that would be a
better solution than the three or four techniques for providing static
attributes that I'm already familiar with.
However, of course, YMMV.
Rapthor wrot
If a property does not exist, why is a null pointer thrown? I assume
you mean java.util.Properties? If so, that does not raise a null
pointer exception.
Rapthor wrote:
Hi,
I think this problem is very interesting. I have a web application that
needs various configuration. I'm using a proper
12 matches
Mail list logo