Servlet container already decoded context,
so does not use TapestryInternalUtils#urlDecode.

But, servlet container does not decode '+' in path to ' ',
so encode ' ' to %20 not to '+' in TapestryInternalUtils.

Escaped slash (%2F) is also decoded by servlet container,
then Tapestry can't distinct escaped slash from real slash.
So escape slash in context to %2F before encode,
then %2F is encoded to %252F in URLCodec#encode.
(also % is escaped to %25 then encoded to %2525)
And unescape in PageRenderDispatcher and ComponentActionDispatcher
(TapestryInternalUtils#unescapePercentAndSlash).

Yoshikazu Kuramochi
added a comment - 19/Dec/07 03:12 - edited I think this issue related to
https://issues.apache.org/jira/browse/TAPESTRY-1968
https://issues.apache.org/jira/browse/TAPESTRY-1911
And, page activation context / component context contains utf8 string
is not decoded correctly (I tested Japanese characters).
I wrote patch to fix these problems.
Summary of this patch:
Servlet container already decoded context,
so does not use TapestryInternalUtils#urlDecode.
But, servlet container does not decode '+' in path to ' ',
so encode ' ' to %20 not to '+' in TapestryInternalUtils.
Escaped slash (%2F) is also decoded by servlet container,
then Tapestry can't distinct escaped slash from real slash.
So escape slash in context to %2F before encode,
then %2F is encoded to %252F in URLCodec#encode.
(also % is escaped to %25 then encoded to %2525)
And unescape in PageRenderDispatcher and ComponentActionDispatcher
(TapestryInternalUtils#unescapePercentAndSlash).
Add some tests.

Francois Armand
added a comment - 29/Jan/08 13:17 I believe this bug is not fully corrected.
The ActivationContext parameter of forms (ac parameter in hidden field) is still encoded but never decoded, so that onActivate(...) methods receive an encoded String.
I think that the method org.apache.tapestry.internal.services.LinkFactoryImpl#addActivationContextToLink(Link link, String[] activationContext) should not call "TapestryInternalUtils.encodeContext()".
It seems to work well on a Tapestry 5.0.6 with theYoshikazu Kuramochi's patch.

Yoshikazu Kuramochi
added a comment - 29/Jan/08 14:18 > The ActivationContext parameter of forms (ac parameter in hidden field) is still encoded but never decoded, so that onActivate(...) methods receive an encoded String.
It is reported by TAPESTRY-2054 and I have posted another patch there.