Re: WOMailDelivery Error In Code
Re: WOMailDelivery Error In Code
- Subject: Re: WOMailDelivery Error In Code
- From: Art Isbell <email@hidden>
- Date: Mon, 10 Mar 2003 15:57:51 -1000
On Monday, March 10, 2003, at 03:27 PM, Jonathan Fleming wrote:
From: Chuck Hill <email@hidden>
-WOSMTPHost"smtp.mac.com" ?
When I put a space in it won't allow me to include the "" quotes... I
put them in and they remove themselves on save, enter or moving to
another aurgument.
I've also tried runing the app without the quotes in the aurgument -
no go.
That's odd. How are you launching your WO app? JavaMonitor and
Project Builder should have no problem expressing the flag with quotes.
I don't see a space after host:
-WOSMTPHost "smtp.mac.com"
Or, set it in code in Application.java:
setSMTPHost("smtp.mac.com");
If I use this option would this be correct:
protected String sMTPHost;
---------
//Application constructor
setSMTPHost("smtp.mac.com");
---------
//Application Body of code
public void setSMTPHost( String value ) {
sMTPHost = value;
}
No, just as Chuck stated. The method setSMTPHost() is defined by
WOApplication, so don't override it.
Now for the obligatory stupid question:
as I don't know excactly how to impliment target aurguments in code I
don't really know where to put this other than here:
WOMailDelivery sharedInstance =
WOMailDelivery.sharedInstance(((Application)application()).sMTPHost());
but then that don't make sense...
So what do I do?
Just set it and forget it. WOMailDelivery will ask Application for
the WOSMTPHost value.
Setting WOSMTPHost may not be the best approach because changing it
would then require code editing, rebuilding, and reinstalling. A more
flexible approach would be to add an entry to the app's Properties file:
WOSMTPHost = smtp.mac.com
But if you wanted to change the SMTP host, you'd then have to edit the
Properties file and restart all instances. So setting WOSMTPHost in
the launch arguments is the most flexible, but doing so might stand
greater risk of forgetting to use this launch flag.
Aloha,
Art
http://homepage.mac.com/aisbell/
_______________________________________________
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.