dev@jsftemplating.java.net

Re: JSFTemplating: encodeURL question

From: Senthil Chidambaram <cchidamb_at_sun.com>
Date: Wed, 14 Feb 2007 18:40:53 -0800

Ken,
Thank You for your quick reply. I'm not having any problem in encoding
it before I call redirect, just looking for a better way. As you said, I
should think of creating another handler which does both.

thx
Senthil

Ken Paulsen wrote:

>
> urlencoding is for encoding the QUERY_STRING portion of a url. If we
> perform this in the redirect() handler, we run the risk of double url
> encoding it. Since the decoding will only happen 1 time, you'll get
> unexpected results. I'd rather keep "redirect()" simple and only have
> it redirect. Feel free to create a new handler, if you want that
> encodes the url after the '?'. Or simply pass individual values to
> urlencode and then concatenate them to form your url.
>
> FWIW, the redirect() api in JSF or in the web container could also do
> this... but they choose not to, probably b/c of similar reasoning.
>
> Are you having any trouble encoding this before the redirect()?
>
> Ken
>
> Senthil Chidambaram wrote:
>
>> Ken,
>> I've a question, before we call sendRedirect() (redirect) handler
>> we've to encode the URL to take care of multibyte chars. Why don't we
>> do this in jsftemplating redirect() handler instead of we doing it
>> before we make a call to redirect().
>>
>> thx
>> Senthil
>