You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Mayne, Peter" <Pe...@ap.spherion.com> on 2003/06/17 02:00:13 UTC

DirectLink encodes rendering

I'm using a DirectLink to add an <a> to my HTML. However, the URL comes out
as

/tap/app?service=direct/1/MainMessage/$DirectLink&amp;sp=Shello

instead of

/tap/app?service=direct/1/MainMessage/$DirectLink&sp=Shello

This breaks my client-side JavaScript, which compares URLs to do formatting.

On the face of it, this looks like a bug to my Tapestry-fresh eyes, but
there may be a good reason for it.

Is it a bug or a feature? Is there a way of telling DirectLink not to encode
the ampersand?

Thanks.

PJDM
-- 
Peter Mayne
Technology Consultant
Spherion Technology Solutions
Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602
T: 61 2 62689727  F: 61 2 62689777

The information contained in this email and any attachments to it:

(a) may be confidential and if you are not the intended recipient, any interference with, 
use, disclosure or copying of this material is unauthorised and prohibited; and

(b) may contain personal information of the recipient and/or the sender as defined 
under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to 
collect, hold and use such information and any personal information contained in a 
response to this email, for any reasonable purpose in the ordinary course of 
Spherion's 
business, including forwarding this email internally or disclosing it to a third party. All 
personal information collected by Spherion will be handled in accordance with 
Spherion's Privacy Policy. If you have received this email in error, please notify the 
sender and delete it.

(c) you agree not to employ or arrange employment for any candidate(s) supplied in 
this email and any attachments without first entering into a contractual agreement with 
Spherion. You further agree not to divulge any information contained in this document 
to any person(s) or entities without the express permission of Spherion.



RE: DirectLink encodes rendering

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
This has come up before.  Tapestry is doing the right thing; the majority of web applications do
not.  The correct thing is to encode the '&' as '&amp;'.  The browser will, internally, convert the
'&amp;' back to a '&' before invoking the HTTP GET.  A bare '&' is not allowed, technically, even
inside an HTML attribute.
 
I'm not sure how to reconcile this with your client side JavaScript.  Perhaps there's a DOM method
that will allow you to extract the true URL from an anchor.
 
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



-----Original Message-----
From: Mayne, Peter [mailto:PeterMayne@ap.spherion.com] 
Sent: Monday, June 16, 2003 8:00 PM
To: 'tapestry-user@jakarta.apache.org'
Subject: DirectLink encodes rendering



I'm using a DirectLink to add an <a> to my HTML. However, the URL comes out as 

/tap/app?service=direct/1/MainMessage/$DirectLink&amp;sp=Shello 

instead of 

/tap/app?service=direct/1/MainMessage/$DirectLink&sp=Shello 

This breaks my client-side JavaScript, which compares URLs to do formatting. 

On the face of it, this looks like a bug to my Tapestry-fresh eyes, but there may be a good reason
for it. 

Is it a bug or a feature? Is there a way of telling DirectLink not to encode the ampersand? 

Thanks. 

PJDM 
-- 
Peter Mayne 
Technology Consultant 
Spherion Technology Solutions 
Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 
T: 61 2 62689727  F: 61 2 62689777