Error Parsing /page.xhtml: Error Traced[line: 42] The entity “nbsp” was referenced, but not declared

Facelets is a XML based view technology. XML has only five predefined entities. The   is not among them. It works only when used in plain HTML or in legacy JSP (note: it doesn’t work in JSPX as that’s also XML based!).

To fix this, you either need to declare the entity yourself in the doctype of the very XHTML file containing the   entity,

<!DOCTYPE html [
    <!ENTITY nbsp "&#160;"> 
]>

or, better, use the (hexa)decimal notation instead:

&#xA0; or &#160;

In an average IDE it should be trivial to perform a “find and replace in all files” and replace every occurrence of &nbsp; by &#xA0;.

Leave a Comment