Results 1 to 1 of 1
  1. #1
    pacinpm is offline Member
    Join Date
    Nov 2010
    Rep Power

    Default Internet Explorer + AJAX + UTF encoding problem

    Hi, I have problem with AJAX responce in Internet Explorer. I have a form with button and backing bean.

    Java Code:
    <h:outputText id="test" value="#{geocodeBean.testUTF()}"/>
    <h:commandButton value="test" type="button">
     <f:ajax event="action" execute="@form" render="test"/>
    Java Code:
    public String testUTF(){
            return "ÓĄŚŁŻŹĆŃĘóęąśżźćń test utf";
    I am using Glassfish as a appserver. Everything works OK in Opera, Firefox and Chrome but in Internet Explorer I get error when I run AJAX responce.

    Error states (translation from Polish): malformedXML: XML Parsing Error, invalid character in text

    It always points to first non Latin character.

    I tried different DOCTYPEs of pages but AJAX is always returned as XML with UTF-8 as encoding.

    What can I do to make it work in IE?

    PS. Below is infromation from Firefox Firebug:

    Request headers
    Java Code:
    Host: localhost:8080
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; pl; rv: Gecko/20101026 Firefox/3.6.12
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: pl,en-us;q=0.7,en;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Faces-Request: partial/ajax
    Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    Referer: http://localhost:8080/index.xhtml
    Content-Length: 437
    Cookie: JSESSIONID=bf0534da72c200d936f3ace73f51; treeForm:tree-hi=
    Pragma: no-cache
    Cache-Control: no-cache
    Answer headers
    Java Code:
    X-Powered-By	Servlet/3.0, JSF/2.0
    Server	GlassFish Server Open Source Edition 3.0.1
    Cache-Control	no-cache
    Content-Type	text/xml;charset=UTF-8
    Content-Length	313
    Date	Tue, 30 Nov 2010 09:05:44 GMT
    Java Code:
    <?xml version="1.0" encoding="utf-8"?>
    <partial-response><changes><update id="main:geo:test"><![CDATA[<span id="main:geo:test">ÓĄŚŁŻŹĆŃĘóęąśżźćń test utf</span>]]></update><update id="javax.faces.ViewState"><![CDATA[1401236602716723051:-877922355409299404]]></update></changes></partial-response>
    Last edited by pacinpm; 11-30-2010 at 10:09 AM.

Similar Threads

  1. Internet Explorer not update applet
    By billlin in forum New To Java
    Replies: 24
    Last Post: 07-18-2010, 12:45 AM
  2. Internet Explorer
    By in forum New To Java
    Replies: 2
    Last Post: 04-17-2009, 05:10 AM
  3. Client Internet Explorer Setting
    By Mir in forum Networking
    Replies: 29
    Last Post: 06-26-2008, 12:01 PM
  4. Internet Explorer java version
    By shimer in forum Java Applets
    Replies: 2
    Last Post: 07-31-2007, 07:30 AM
  5. Problems with Internet Explorer and SSL Java
    By Peter in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 07:13 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts