0 Replies Latest reply on May 6, 2010 2:17 AM by TorstenKarusseit

    Problem with HttpHeader Accept-Language with InternetExplorer

    TorstenKarusseit

      I'm building an web application using Flash at the front side and Jetty at the back side.

      This application has to care of the language settings of the browser.

      Normally the browser sends with each request the Http-header accept-language in wich the language settings of the browser are reflected.

      To check this I wrote a servlet wich echos the request with its headers.

      Here is the output for FF:

      <code>

      >>>TestServlet0<<<
      ------------------------------------
      HttpServletRequest.getRequestURI
      /Era09Web/TestServlet0
      ------------------------------------
      HttpServletRequest.getHeader
      Host : localhost:8080
      User-Agent : Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9
      Accept : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
      Accept-Language : en-gb,de-at;q=0.5
      Accept-Encoding : gzip,deflate
      Accept-Charset : ISO-8859-1,utf-8;q=0.7,*;q=0.7
      Keep-Alive : 300
      Connection : keep-alive
      Cache-Control : max-age=0
      ------------------------------------

      HttpServletRequest.getLocale: Englisch (Vereinigtes Königreich)

      </code>

      Here is the output for IE:

      <code>

      >>>TestServlet0<<<
      ------------------------------------
      HttpServletRequest.getRequestURI
      /Era09Web/TestServlet0
      ------------------------------------
      HttpServletRequest.getHeader
      Accept : */*
      Accept-Language : en-GB,de-AT;q=0.5
      User-Agent : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MSN OptimizedIE8;DEDE)
      Accept-Encoding : gzip, deflate
      Host : localhost:8080
      Connection : Keep-Alive
      ------------------------------------
      HttpServletRequest.getLocale: Englisch (Vereinigtes Königreich)

      </code>

      That looks ok, but it was without Flash jet.

      Now the same info requested by mx.rpc.http.HTTPService.

      First for FF:

      <code>

      RequestURL : http://localhost:8080/Era09Web/DownServlet
      HttpHeader:
      Host : localhost:8080
      User-Agent : Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9
      Accept : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
      Accept-Language : en-gb,de-at;q=0.5
      Accept-Encoding : gzip,deflate
      Accept-Charset : ISO-8859-1,utf-8;q=0.7,*;q=0.7
      Keep-Alive : 300
      Connection : keep-alive
      RequestLocale : Englisch (Vereinigtes Königreich)

      </code>

      Second for IE:

      <code>

      RequestURL : http://localhost:8080/Era09Web/DownServlet
      HttpHeader:
      Accept : */*
      Referer : http://localhost:8080/Diagramm1.swf
      Accept-Language : de-DE
      User-Agent : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MSN OptimizedIE8;DEDE)
      Accept-Encoding : gzip, deflate
      Host : localhost:8080
      Connection : Keep-Alive
      x-flash-version : 9,0,124,0
      RequestLocale : Deutsch (Deutschland)

      </code>

      Question: Why with IE it shows me de-DE and not en-GB ?