Re: Slashes in query/context parameter

Cezary Biernacki <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE26fNjEzziZxF6RdCYEGNo2o+45YFAN-=tvwenBN=setNsDhA@mail.gmail.com>
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
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.