由于错误c00ce56e无法完成操作

wut*_*aer 11 java ajax richfaces jsf-2 internet-explorer-9

我已经从富脸3.3升级到富脸4.2因为ajax不能用于IE9.现在它仍然不起作用.

在收到响应之后IE获得了一个JS错误"SCRIPT58734:Der Vorgang konnte aufgrund des folgenden Fehlers nicht fortgesetzt werden:c00ce56e." 在尝试时

data.responseText=request.responseText
Run Code Online (Sandbox Code Playgroud)

在jsf.js.html?ln = javax.faces&conversationContext = 2,第1行第21747行

我认为这是因为一个不完整的HTTP标头

Content-Type: text/xml;charset=UTF8
Run Code Online (Sandbox Code Playgroud)

应该

Content-Type: text/xml;charset=UTF-8
Run Code Online (Sandbox Code Playgroud)

这是服务器的原始响应

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: JSF/2.0
Cache-Control: no-cache
Content-Type: text/xml;charset=UTF8
Content-Length: 293
Date: Tue, 17 Apr 2012 15:25:22 GMT

<?xml version='1.0' encoding='UTF8'?>
<partial-response><changes><update id="outtest"><![CDATA[<span id="outtest"><span     class="outhello">Hello !</span></span>]]></update><update id="javax.faces.ViewState"><![CDATA[2809980525147413088:295565165947012503]]></update></changes></partial-response>
Run Code Online (Sandbox Code Playgroud)

我正在使用

javaee-web-api 6
myfaces-orchestra-core 1.4
Hibernate  4.1
Spring 3.1.1
Richfaces 4.2.0
Primefaces 3.2
jsf-api+impl 2.1.7
Run Code Online (Sandbox Code Playgroud)

jstl 1.2

并在tomcat 7上运行

编辑:现在我确定它的标题.我在charles-proxy中设置了一个断点并手动编辑了响应头,编辑后的http头IE9显示了正确的结果,没有任何错误

Bal*_*usC 18

你的分析是正确的.标头中的charset属性Content-Type是错误的,IE9因错误而窒息c00ce56e.

默认情况下,JSF使用从中获取的那个ServletRequest#getCharacterEncoding().这通常默认为客户端指定的一个,或者null如果没有(通常是这种情况).这通常可以通过调用的一些自定义过滤器来覆盖request.setCharacterEncoding().

由于不正确的字符集,这只能意味着你的Web应用程序调用的地方request.setCharacterEncoding()"UTF8"替代"UTF-8".

我开始检查所有过滤器及其配置.