I\'d like to use non breaking spaces in my JSF page. I know, in plain HTML I could use
for this and this works fine. However, when I put those
<![CDATA[ ]]>
should work fine. This does not work inside attribute value, though.
Alternatively, as long as &
is a predefined entity in XML, you could try &nbsp;
- worked for me with XML based JSP. This should work within attributes as well.
For me the following doctype enables
:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Try using &#160;
. for more information on entities you can refer following url HTML ISO-8859-1 Reference
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 " ">
]>
or, better, use the (hexa)decimal notation instead:
  or  
In an average IDE it should be trivial to perform a "find and replace in all files" and replace every occurrence of
by  
.
add
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
to the top of the file