Re: Slashes in query/context parameter
Nathan Quirynen <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.user |
|---|---|
| Organization | Pension Architects |
| Message-ID | <[email protected]> |
Hi Cezary,
Thanks, exactly what I needed.
As I am creating the link with the url parameter in another Tapestry
application I can just use the URLEncoder.encode() method.
Op 20/06/2017 om 21:57 schreef Cezary Biernacki:
> Tapestry uses its own encoding (with $ used as escape + four hex digits
> unicode) for URLs, see org.apache.tapestry5.services.URLEncoder and
> implementation org.apache.tapestry5.internal.services.URLEncoderImpl
> <https://github.com/apache/tapestry-5/blob/master/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/URLEncoderImpl.java>
> .
>
> Try https://abc.com/?redirectUrl=https:$002f$002fdef.com$002fabc123$002f456
>
>
>
> You can test encodings with this code:
>
> TestPage.java
>
> public class TestPage {
>
> @ActivationRequestParameter
> @Property
> private String redirectUrl;
>
> public void onActivate() {
> if (redirectUrl == null) {
> redirectUrl = "http://example.org/page";
> }
> }
> }
>
>
> TestPage.tml
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
> <body>
> <div>
> <t:form>
> <t:textfield value="redirectUrl"/>
> <t:submit/>
> </t:form>
> </div>
> </body>
> </html>
>
>
>
> On Tue, Jun 20, 2017 at 6:12 PM, Nathan Quirynen <
> [email protected]> wrote:
>
>> Hi,
>>
>> I have a page that needs to accept an url as query or context parameter.
>>
>> So for example: https://abc.com?redirectUrl=https://def.com/abc123/456
>>
>> But Tapestry does not accept the slashes (even if I use the %2F notation):
>>
>> *Input string '[...]' is not valid; the character '/' at position 7 is not
>> valid.*
>>
>> How can I achieve what I need with Tapestry?
>>
>>
>> Nathan
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]