You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Borut Bolčina <bo...@gmail.com> on 2009/03/09 18:07:05 UTC

base64 + url encoded activation context parameter

Hi,

I wanted to send users an email with a confirmation link which
includes base64 encoded and additionally url encoded activation
context

Example:
http://my.company.com/account/confirmed/amFuZXpuOu47TZYaxgNZ297XcGQFHLQ%3D

As base64 includes characters + / and = I tried to encode it further
with URLCodec (apache commons codec) so it looks like the above
example.

But the Tapestry complains with

java.lang.IllegalArgumentException
Input string 'amFuZXpuOu47TZYaxgNZ297XcGQFHLQ=' is not valid; the
character '=' at position 32 is not valid.

which I can understand as it decodes the link automatically
Stack trace

        * org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:143)
        * org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:70)
        * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:88)

What is the cleanest solution? Is there a known url safe
encoder/decoder which I can use or do I have to write one myself?

Regards,
Borut

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


Re: base64 + url encoded activation context parameter

Posted by Andy Pahne <an...@googlemail.com>.
compare this thread...


http://tapestry.markmail.org/search/?q=list%3Aorg.apache.tapestry.users+url+#query:list%3Aorg.apache.tapestry.users%20url%20+page:1+mid:kbv6yrkcjmkaaoys+state:results


Borut Bolčina schrieb:
> Hi,
>
> I wanted to send users an email with a confirmation link which
> includes base64 encoded and additionally url encoded activation
> context
>
> Example:
> http://my.company.com/account/confirmed/amFuZXpuOu47TZYaxgNZ297XcGQFHLQ%3D
>
> As base64 includes characters + / and = I tried to encode it further
> with URLCodec (apache commons codec) so it looks like the above
> example.
>
> But the Tapestry complains with
>
> java.lang.IllegalArgumentException
> Input string 'amFuZXpuOu47TZYaxgNZ297XcGQFHLQ=' is not valid; the
> character '=' at position 32 is not valid.
>
> which I can understand as it decodes the link automatically
> Stack trace
>
>         * org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:143)
>         * org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:70)
>         * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:88)
>
> What is the cleanest solution? Is there a known url safe
> encoder/decoder which I can use or do I have to write one myself?
>
> Regards,
> Borut
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>   


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


Re: base64 + url encoded activation context parameter

Posted by Lutz Hühnken <lh...@googlemail.com>.
Hi Borut,

right, Base 64 encoding is no good for URLs. See
"http://en.wikipedia.org/wiki/Base64#URL_applications".

> What is the cleanest solution? Is there a known url safe
> encoder/decoder which I can use or do I have to write one myself?

I know there is one implementation included in the bouncycastle
cryptography tools, see
"http://www.bouncycastle.org/docs/docs1.6/org/bouncycastle/util/encoders/UrlBase64.html".
You'll probably find others if you google around.

Hth,

Lutz



-- 
altocon GmbH
http://www.altocon.de/
Software Development, Consulting
Hamburg, Germany

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