You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by Finn Bock <bc...@gmail.com> on 2010/06/18 21:21:09 UTC
Setting character encoding on individual pages.
Hi,
Normally I use UTF-8 for the request character encoding, but a few
pages needs to accept requests from other systems that uses a
different encoding for request parameters. I can achieve that by
setting the character encoding in the page constructor or doing it in
a page-interceptors preCreate() method.
Except when the application is running in TRACE mode due to the
logging at the beginning of ClickServlet.createPage(context):
// Log request parameters
if (logger.isTraceEnabled()) {
logger.trace(" is Ajax request: " + context.isAjaxRequest());
logRequestParameters(request);
}
since access to parameters means that subsequent changes to the
character encoding is ignored.
Would it by reasonable to move the logRequestParameters() call down to
after the pageinterceptor.preCreate() call?
regards,
Finn
Re: Setting character encoding on individual pages.
Posted by Finn Bock <bc...@gmail.com>.
2010/6/19 Bob Schellink:
> ... The other scenario which won't be catered for is when dealing with file uploads since
> the request is parsed during Context creation.
Ahh yes, you are right, it will not work in that case. I'll have to do
it someway else.
regards,
Finn
Re: Setting character encoding on individual pages.
Posted by Bob Schellink <sa...@gmail.com>.
On 19/06/2010 05:21, Finn Bock wrote:
>
> Would it by reasonable to move the logRequestParameters() call down to
> after the pageinterceptor.preCreate() call?
Sounds good. But that still means the logRequestPArameters is invoked before the page is
constructed. The other scenario which won't be catered for is when dealing with file uploads since
the request is parsed during Context creation.
Regards
Bob