Re: WebObjects command line parsing help
Re: WebObjects command line parsing help
- Subject: Re: WebObjects command line parsing help
- From: Jevon Hills <email@hidden>
- Date: Tue, 18 Mar 2003 17:09:44 -0700
Thanx - that helped. Got it goin.
ttfn
On Tuesday, March 18, 2003, at 03:21 PM, Art Isbell wrote:
On Tuesday, March 18, 2003, at 11:46 AM, Jevon Hills wrote:
I would like to be able to parse some custom commandline parameters
to set properties in my application at launch. What I would like to
to is add the following line in my command lines section
DmyFlag YES
or
DmyFlag NO
As far as I can tell I can create a 'Properties' file in WebObjects
and use this. does anyone have a working example that they could
share.
If you could substitute true/false for YES/NO, in your Application
constructor:
myFlag = Boolean.getBoolean("myFlag");
in which "myFlag" is an Application instance variable with an
appropriate accessor method that supports access of myFlag from other
objects. If myFlag isn't set in the Properties file or as a launch
argument, myFlag will be false.
If you must use YES/NO values:
String value = System.getProperty("myFlag", defaultValue);
in which "defaultValue" is the value if no "myFlag" Properties entry
or launch argument exist.
The Properties entry would look like:
myFlag = true
A launch argument takes precedence over a Properties entry which
takes precedence over a default value defined in Java code.
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
Jevon K. Hills
Developer - Zymeta Media Promotion Systems
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.