Re: Could someone help me decipher this?
Re: Could someone help me decipher this?
- Subject: Re: Could someone help me decipher this?
- From: Sacha Mallais <email@hidden>
- Date: Mon, 22 Aug 2005 10:29:07 -0700
On Aug 22, 2005, at 10:20 AM, Baiss Eric Magnusson wrote:
I have some code:
In DirectAction
public WOActionResults changeRegionAction() {
Main main = (Main)pageWithName("Main");
main.changeCookie( cookie1, cookie2, cookie3 );
In Main
public void changeCookie( WOCookie cookie1, WOCookie cookie2,
WOCookie cookie3 ) {
System.out.println("changeCookie-> " + cookie1.toString());
curRegionName = (String)cookie1.valueForKey("region");
***************
The <println> yields:
changeCookie-> <com.webobjects.appserver.WOCookie name=region
value=Northwest path=/ domain=.nwDUP.org isSecure=false>
But an exception is thrown:
<DirectAction>: Exception in performActionNamed() on the action
"changeRegion" with the message:
com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException:
<com.webobjects.appserver.WOCookie 0x507aaf> valueForKey(): lookup
of unknown key: 'region'.
Stack trace:
WOCookie.java 542 valueForKey com.webobjects.appserver
Main.java 116 changeCookie Main
DirectAction.java 57 changeRegionAction DirectAction
I stare at it, and I see the <name=region> in the output, and
wonder why it is not seeing that key?
I would guess that keyForValue("region") would have more success, if
such a method existed.
OTOH, maybe you mean valueForKey("name")...
sacha
--
Sacha Michel Mallais - 400 lb. chimp
Global Village Consulting Inc.: http://www.global-village.net/
Choke on that, causality! -- the Professor, "Futurama"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden