Bug in WOContext.directActionURLForActionNamed() when using query dictionary
Bug in WOContext.directActionURLForActionNamed() when using query dictionary
- Subject: Bug in WOContext.directActionURLForActionNamed() when using query dictionary
- From: Nathan Hadfield <email@hidden>
- Date: Wed, 26 Apr 2006 16:49:19 -0600
I seem to have encountered a bug in
WOContext.directActionURLForActionNamed(). When I pass it a query
dictionary containing more than one key, it returns a string in which
the query arguments are separted by '&' instead of just an
ampersand. As a result, if I pass a query dictionary containing
{ arg1 = x; arg2 = y }, it returns a URL looking like this:
/cgi-bin/WebObjects/AppName.woa/wa/MyActions/go?arg1=x&arg2=y
whereas the correct URL would be
/cgi-bin/WebObjects/AppName.woa/wa/MyActions/go?arg1=x&arg2=y
I have traced the problem down to a the private static method
com.webobjects.appserver._private.WOURLEncoder.encodeAsCGIFormValues
( NSDictionary dict )
which returns the encoded pairs joined by '&'.
I'm using WO 5.3 with Xcode 2.2.1. I'm pretty sure this was working
correctly in earlier versions. My workaround for now is to either
replace occurrences of '&' in the result with just '&'--but this
would cause problems if there was a legitimate & in one of the
query values. Another option is include "amp;" as a prefix when
retrieving form values in the direct action.
I have submitted a bug report to Apple but I'm curious whether anyone
else has encountered this, or if anyone has a better workaround?
Thanks,
Nathan
_______________________________________________
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