• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WebObjects command line parsing help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebObjects command line parsing help


  • Subject: Re: WebObjects command line parsing help
  • From: Art Isbell <email@hidden>
  • Date: Tue, 18 Mar 2003 12:21:53 -1000

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.

  • Follow-Ups:
    • Re: WebObjects command line parsing help
      • From: Jevon Hills <email@hidden>
References: 
 >WebObjects command line parsing help (From: Jevon Hills <email@hidden>)

  • Prev by Date: Re: Fetch problem fixed by myself :-)
  • Next by Date: Re: SELECT DISTINCT with Display group
  • Previous by thread: WebObjects command line parsing help
  • Next by thread: Re: WebObjects command line parsing help
  • Index(es):
    • Date
    • Thread