Hello Davide,

you can inject the Request (org.apache.tapestry5.services.Request) service
into your page and then access the parameter with

request.getParameter("myParam")

this should go around the tapestry encoding and type coercing mechanisms.

Felix

2016-05-20 13:57 GMT+02:00 Davide Vecchi <d...@amc.dk>:

> Hi everybody ,
>
> In order to have a Tapestry page correctly receive an
> @ActivationRequestParameter , the value in the querystring must be sent
> encoded in the Tapestry way (f.ex. using Tapestry's URLEncoder service), so
> f.ex. a space char becomes $0020 , a "&"becomes $0026 etc.
>
> However this encoding is Tapestry-specific while I need to write a page
> that can be called by third parties, which encode querystring parameters in
> the standard way, that is with "percent encoding", where f.ex. a space
> becomes %20 instead of $0020.
>
> Currently when my Tapestry page receives a querystring parameter
> containing a character encoded in that way, f.ex.
>
>         TestPage?myParam=A%20Z
>
> , I get a ComponentEventException:
>
>         Input string 'A Z' is not valid; the character ' ' at position 2
> is not valid.
>
> From that error message it would appear that Tapestry does correctly
> decode the %20 into a space, but at the same time it throws the exception,
> while if I use Tapestry encoding for that char, so
>
>         TestPage?myParam=A$0020Z
>
> , everything is good and no exception is thrown.
>
> So I would like to know if there is a clean / recommended approach to
> receiving percent-encoded parameters like %20 from a Tapestry page.
>
> Although I'm currently using @ActivationRequestParameter, this is not a
> requirement so it would not be a problem to drop this annotation and use
> something else if necessary.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to