4

I wonder why WebKit trying to render my page as XML instead of HTML.. I tried this issue (via emulator and real device) for all available Android SDK versions and all OK only since Android 2.3.4 (API 10) with WebKit/533.1 One more strange thing is browser versions:

Android 2.2.1 has WebKit/533.1 and Android 2.3.4 also has WebKit/533.1

So, my page does not want to render in 2.2.1 with 533.1, but all good in 2.3.4 with the same 533.1?? Page code is simple:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <title>Title</title>
</head>
<body>
...
</body>
</html>

Google says I must declare Content-Type header as text/html, but it has been already declared. What I can see with LiveHTTPHeaders (Firefox add-on) while requesting that JSF page:

HTTP/1.1 200 OK
X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.1 Java/Sun Microsystems Inc./1.6), JSF/2.0
Server: GlassFish Server Open Source Edition 3.1.1
Content-Type: text/html;charset=UTF-8
Content-Length: 1559
Date: Tue, 13 Mar 2012 19:50:13 GMT

Did you meet such kinds of issues?

Thanks, Vladimir

Vladimir Kishlaly
  • 1,872
  • 1
  • 16
  • 26

1 Answers1

0

I have found the solution. Just remove <ui:composition> tag from inside body.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Vladimir Kishlaly
  • 1,872
  • 1
  • 16
  • 26
  • That tag is a templating tag, you should not have used it in the body of a single non-templated view at all. Any content outside `` is disregarded and the template file as definied in `template` attribute would be used. See also http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets/4793959#4793959 – BalusC Mar 26 '12 at 15:02