You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dave Kallstrom <da...@gmail.com> on 2007/07/31 23:21:00 UTC

Problem with XTile component

I am having problem getting the XTile component to correctly send data back
to the server. Whenever a user types in a string with an ampersand in it the
text after the ampersand as well as the ampersand itself is being cut off.
For example "this & that" is being sent back to the server as "this". I
believe there was a change made to the XTile component to replace the
homegrown regular expression uri encoder to use the javascript encodeURI()
function. Could this be the problem? I am certain this was working in
previous releases of tapestry. We are currently on 4.1.2
Any help would be appreciated.

-- 
Dave Kallstrom

Re: Problem with XTile component

Posted by Ben Dotte <be...@gmail.com>.
Ok, found TAPESTRY-977 to explain the change. Dave found he could use
the old escaping functionality from Tapestry 4.0
(escape(text).replace(/\+/g,
'%2B').replace(/\"/g,'%22').replace(/\'/g, '%27');) to pass the value
into XTile, then decode in the listener using URLDecoder.decode(value,
"UTF-8");.

So I guess XTile used to handle escaping of &, +, etc., but now it is
the expectation that the code using XTile will escape those things
properly.

I guess that makes sense, as long as it is consistent :)

Ben

On 8/1/07, Ben Dotte <be...@gmail.com> wrote:
> It appears this became a problem when XTile.script started using
> encodeURI() to encode the request parameters instead of escape(). In
> the commit history I don't see a specific case tied to the change.. it
> says only "Refactored XTile to use encodeURI() to encode url
> parameters".
>
> Jesse - Do you remember why this change was made? The example Dave (my
> coworker) gives below does indeed break on 4.1.2 but works on 4.0.
>
> Thanks,
> Ben
>
> ---------- Forwarded message ----------
> From: Dave Kallstrom <da...@gmail.com>
> Date: Jul 31, 2007 4:21 PM
> Subject: Problem with XTile component
> To: Tapestry users <us...@tapestry.apache.org>
>
>
> I am having problem getting the XTile component to correctly send data back
> to the server. Whenever a user types in a string with an ampersand in it the
> text after the ampersand as well as the ampersand itself is being cut off.
> For example "this & that" is being sent back to the server as "this". I
> believe there was a change made to the XTile component to replace the
> homegrown regular expression uri encoder to use the javascript encodeURI()
> function. Could this be the problem? I am certain this was working in
> previous releases of tapestry. We are currently on 4.1.2
> Any help would be appreciated.
>
> --
> Dave Kallstrom
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Fwd: Problem with XTile component

Posted by Ben Dotte <be...@gmail.com>.
It appears this became a problem when XTile.script started using
encodeURI() to encode the request parameters instead of escape(). In
the commit history I don't see a specific case tied to the change.. it
says only "Refactored XTile to use encodeURI() to encode url
parameters".

Jesse - Do you remember why this change was made? The example Dave (my
coworker) gives below does indeed break on 4.1.2 but works on 4.0.

Thanks,
Ben

---------- Forwarded message ----------
From: Dave Kallstrom <da...@gmail.com>
Date: Jul 31, 2007 4:21 PM
Subject: Problem with XTile component
To: Tapestry users <us...@tapestry.apache.org>


I am having problem getting the XTile component to correctly send data back
to the server. Whenever a user types in a string with an ampersand in it the
text after the ampersand as well as the ampersand itself is being cut off.
For example "this & that" is being sent back to the server as "this". I
believe there was a change made to the XTile component to replace the
homegrown regular expression uri encoder to use the javascript encodeURI()
function. Could this be the problem? I am certain this was working in
previous releases of tapestry. We are currently on 4.1.2
Any help would be appreciated.

--
Dave Kallstrom

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org