Javax.faces.view.facelets.FaceletException: error analysis /template.xhtml: object "nbsp" referenced but not declared

In my Facelets template, I used doctype XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I would like to change this to HTML5 doctype in accordance with the general recommendation:

<!DOCTYPE html>

However, the JSF threw a parsing error:

javax.faces.view.facelets.FaceletException: error analysis /template.xhtml: error. Trace [line: 42] The "nbsp" object was referenced but not declared.

Then the HTML object is &nbsp;not parsed. The object is used as follows:

<p:menuitem value="&nbsp;My menuitem">

How is this caused and how can I solve it?

+4
source share
1 answer

HTML5 . , UTF-8. , "" HTML5 . , , , , .

Facelets, , XML XML- &lt;, &gt;, &amp;, &quot; &apos;. &nbsp; .

2 ( 3- , ):

  • &nbsp; doctype:

    <!DOCTYPE html [
        <!ENTITY nbsp "&#xA0;"> 
    ]>
    
  • , (hexa):

    &#xA0; or &#160;
    
+7

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


All Articles