[SOLVED]Re: WOCookie value() returns quoted/parenthesized string not string
[SOLVED]Re: WOCookie value() returns quoted/parenthesized string not string
- Subject: [SOLVED]Re: WOCookie value() returns quoted/parenthesized string not string
- From: Baiss Eric Magnusson <email@hidden>
- Date: Wed, 28 Sep 2005 14:18:43 -0700
Thanks, a light bulb went off when you stated the stuff about the
serialized dictionary. I had read the docs but hadn't groked the
meaning.
Also, thanks to those who replied about WOText and <escapeHTHM>;
change the WOText to a WOString. I considered filing an enhancement
request on ADC for WOText but after thinking about it decided that it
was appropriate as it is.
Asking simple questions is a good idea!
So, I got the alpha release up, I have until the end of the year to
complete the site, non-profits are easy to work with...
And, it's off to Canada's Gulf Spring Islands for the wife's birthday
and a short vacation.
Cheers,
Baiss
On Sep 28, 2005, at 10:40 AM, Chuck Hill wrote:
On Sep 28, 2005, at 10:25 AM, Baiss Eric Magnusson wrote:
When I look at the cookie and when I set it, the value is <WA>
But when I do:
cookie = (WOCookie)allCookies.objectAtIndex(i);
if ( cookie.name().equals("state")) curStateName =
cookie.value();
curStateName is <("WA")> not <WA>.
When working with WO it is important to keep in mind that ("...",
"...") is a serialized array and that {"..."="...";} is a
serialized dictionary. The docs for WOCookie.value state: "This
value attribute is similar to the value of a dictionary or hash
table."
So, what you have above is a serialized array. The reasoning
behind this is that the spec allows for multiple cookies with the
same name. You could de-serialize this into an NSArray and get the
first object, or use the WORequest method
curStateName = request().cookieValueForKey("state");
which "Returns the first value in the request for the given cookie
name as specified by aKey."
HTH
Chuck
----
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:
This email sent to email@hidden