Android WebKit and JavaServerFaces

I wonder why WebKit is trying to render my page as XML instead of HTML. I tried this problem (through emulator and real device) for all available versions of Android SDK and everything is fine only with Android 2.3.4 (API 10) using WebKit / 533.1 Another 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 display in 2.2.1 with 533.1, but everything is fine in 2.3.4 with the same 533.1 ?? The 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 that I should declare the Content-Type header as text / html, but it is already declared. What I see with LiveHTTPHeaders (Firefox add-on) requesting this 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 

Have you encountered such problems?

Thank you Vladimir

+4
source share
1 answer

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

0
source

Source: https://habr.com/ru/post/1401840/


All Articles