• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WebObjects 5.3.1 Redirect bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebObjects 5.3.1 Redirect bug?


  • Subject: Re: WebObjects 5.3.1 Redirect bug?
  • From: David LeBer <email@hidden>
  • Date: Wed, 16 Nov 2005 09:08:57 -0500


On 16-Nov-05, at 5:24 AM, Dev WO wrote:

<snip>

I don't think the bug is in the hyperlink generation, because it was doing this in 5.2.2 and before (which isn't that old;)) and no one mentioned a bug about this. And at least the &amp; in the source code of the (X)HTML is the correct way of doing it.

This is not the issue. Having encoded ampersands in the source html is fine (and expected). It is having encoded ampersands in the request that is causing the problem.


<snip>
I'm not as advance as any of you in WO, but I have some simple DA which lead to a product based on its PK like
productPK=15&amp;wosid=blabla
and it works just fine...
Maybe because there's not that much parameter and I'm requesting the value of the first one.
The wosid is working well too, so it must be getting correctly too...
As I told you I'm not enough "good" to tell you what's wrong:( The only thing I can say is that the &amp; in an hyperlink is correct.

To clarify: Generating a url for inclusion on a page works. The encoded ampersands that separate the query parameters are appropriate in that context. However if you hand that url to a WORedirect (not rendered on a page and interpreted by a web browser) the encoded ampersands are being sent to the server in the request. That fails with the results I documented.


As I mentioned before I don't know how it *should* work (whether the request should gracefully handle encoded ampersands, or whether WORedirect should convert the encoded ampersands before passing them on). All I know is that is where it is failing.

<snip>

Pre: {valueZero = "Zero"; valueTwo = "Two"; valueOne = "1"; }
URL: /cgi-bin/WebObjects/TestRedirect.woa/-50628/wa/default? valueZero=Zero&amp;valueTwo=Two&amp;valueOne=1&amp;wosid=LDHjmeMHbkGC QGRnoremEw
Post: {valueZero = ("Zero"); amp;valueTwo = ("Two"); amp;valueOne = ("1"); amp;wosid = ("LDHjmeMHbkGCQGRnoremEw"); }
Keys: ("valueZero", "amp;valueTwo", "amp;valueOne", "amp;wosid")

I'm asking this just to understand, why are you using "post" on a hyperlink?
If it's a form so there's nothing written in the (X)HTML source code and the form will submit with & as it's passing parameter (which is correct).
There's no "post" action for a hyperlink.


Could you clarify what you trying to do?
It may be obvious, but I don't understand with my limited knowledge;)

Sorry, no post action. Poor choice of NSLog identifiers. The 'Pre' string is the query dictionary before being sent, the 'URL' string is the generated url, and the 'Post' string is the query dictionary in the DirectAction request.


Also informative is to take a look at the raw query string (everything after the '?' in the request url) in the request()

// in the DirectAction
	NSLog.out.appendln("Query String: " + request().queryString());

From a WOHyperlink request (a url rendered to a page and interpreted by a browser) you get something like this:

productPK=15&wosid=blabla

From a WORedirect request you get something like this:

productPK=15&amp;wosid=blabla

This is the problem (see disclaimer above). WO burps on decoding this request, the result is that the keys for the resulting form values dictionary have 'amp;' (everything after the &) appended to them.

As an ugly hack I'm calling replaceAll("&amp;", "&") on the url before I hand it off to the WORedirect. Yuck.

--
;david

--
David LeBer
"I am codeferous!"
Codeferous Software
site:   http://www.codeferous.com
blog: http://david.codeferous.com




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: WebObjects 5.3.1 Redirect bug?
      • From: Dev WO <email@hidden>
References: 
 >WebObjects 5.3.1 Redirect bug? (From: David LeBer <email@hidden>)
 >Re: WebObjects 5.3.1 Redirect bug? (From: Lachlan Deck <email@hidden>)
 >Re: WebObjects 5.3.1 Redirect bug? (From: Dev WO <email@hidden>)
 >Re: WebObjects 5.3.1 Redirect bug? (From: Lachlan Deck <email@hidden>)
 >Re: WebObjects 5.3.1 Redirect bug? (From: Dev WO <email@hidden>)

  • Prev by Date: Re: More newbie questions
  • Next by Date: Re: WebObjects 5.3.1 Redirect bug?
  • Previous by thread: Re: WebObjects 5.3.1 Redirect bug?
  • Next by thread: Re: WebObjects 5.3.1 Redirect bug?
  • Index(es):
    • Date
    • Thread