dev@jsftemplating.java.net

Re: JSFTemplating: encodeURL question

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Wed, 14 Feb 2007 18:21:28 -0800

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