ccppjava
ccppjava

Reputation: 2615

How could I remove the first line of <?xml ...?> in JSF?

I am using JSF, and all toturial has first line in the *.xhtml similar as follows:

<?xml version="1.0" encoding="UTF-8"?>

however, sometimes Richface generated JavaScript content is not wrapped in CDATA, which cause firefox sometimes complain about not proper XML.

Can I remove the first line from the xhtml directly? or is there a way to suppress the xml entity definition by configuration?

Upvotes: 2

Views: 272

Answers (1)

BalusC
BalusC

Reputation: 1109252

You can safely remove it. You can even use the HTML5 doctype. Facelets will only remove the XML prolog from include files, template clients and composites, but not from the master template.

See also:


however, sometimes Richface generated JavaScript content is not wrapped in CDATA, which cause firefox sometimes complain about not proper XML.

If RichFaces really did that (and thus not yourself!), then it's a bug in RichFaces. You'd really need to report it to RichFaces issue tracker. I have however never seen that before.

Upvotes: 3

Related Questions