. Advertisement .
..3..
. Advertisement .
..4..
How to solve the problem – this xml file does not appear to have any style information associated with it? I have the sample detail:
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/WEB-INF/templates/template_a.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:define name="title">
tytol
</ui:define>
</ui:composition>
While I was running it, I found the warning message:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
That is my question in my midterm exam, and it is urgent. I searched the solutions on some websites, but I didn’t get it. I may miss any line or other changes. I appreciate your assistance!
The cause: The message of error occurs because the web browser processed the obtained HTTP response content as XML instead of HTML, Due to a missing or erroneous HTTP response content type.
If the HTTP request didn’t invoke the
FacesServlet
, it wasn’t able to read the Facelets file and generate the necessary HTML output based on the XHTML source code, which can happen in the case ofJSF/Facelets
files with the default extension of.xhtml
. Firefox then just guesses the HTTP response content type based on the.xhtml
file extension, which is evidently regarded astext/xml
by default in your Firefox settings.Solution:
To fix the problem, make sure the HTTP request URL in the browser’s address bar matches the
<url-pattern>
of theFacesServlet
in the webapp, so it can build the required HTML output based on the XHTML source code. If it’s *.jsf, for example, you should open the page using/some.jsf
rather than/some.xhtml
. Alternatively, you may use*.xhtml
as theurl-pattern
. You’ll never have to deal with phantom URLs again.Add xmlns=”http://www.w3.org/2000/svg” atrribute to the begining of the svg tag like this:
<svg xmlns="http://www.w3.org/2000/svg"