myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Müllan" <>
Subject Re: character encoding in AJAX requests...suggestions?
Date Tue, 23 May 2006 21:27:46 GMT

I like the idea of having an own attribute for the char encoding and
putting this value to the ajax request. We can set encoding type in
the phaselistener without waiting for the explicit call to the
component itself. Can be done right at the beginning and also looks
like a more generic solution.

Doesn`t seem being a hack to me!



On 5/23/06, sharath reddy <> wrote:
> Hello,
> Here is the gist of TOMAHAWK-208:
> When inputSuggestAjax gets rendered, the
> AjaxDecodePhaseListener does not set the content type
> of the response to the (expected)
> text/html;charset=UTF-8 (or whatever). There's not
> type or charset specified at all.
> Rumiana then suggests: Maybe "charset=UTF-8" should be
> specified somewhere as well.
> In a JSF page, it is possible to set the
> response.setContentType() attribute:
> <%@ page session="false"
> contentType="text/html;charset=utf-8"%>
> The problem is, for AJAX requests, how do we specify
> the charset explicity, when we want to do so?
> One solution would be to add the 'charset' attribute
> to the AJAX component. When the AjaxPhaseListener
> invokes the component (by calling 'encodeAjax'), this
> attribute can be set on the response.
> The problem with this approach is that the contentType
> has to be set BEFORE getWriter() is called on the
> Response. So by the time the component is invoked, it
> is already be too late.
> Another potential solution is to have the AJAX call to
> the server have a 'charset=' parameter. The
> AjaxPhaseListener will check for this parameter in the
> request and set the content-type accordingly in the
> response.
> I'm just looking for best way to do this without
> seeming like a hack.
> Any ideas/suggestions?
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around

Gerald Müllan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506

View raw message