Re: Could someone help me decipher this?
Re: Could someone help me decipher this?
- Subject: Re: Could someone help me decipher this?
- From: David Koski <email@hidden>
- Date: Mon, 22 Aug 2005 10:32:04 -0700
Hi,
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'.
The cookie's name = "region", it does not have a key named region.
You may want:
cookie1.valueForKey("name")
or even
cookie1.name()
Both should return the string "region". I don't know if that fits
the semantics of what you want, but it will match what you have at
least.
dk
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?
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
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