webtier@glassfish.java.net

JSF 2.0: Why is & nbsp; Illegal in Included Files?

From: <webtier_at_javadesktop.org>
Date: Fri, 13 Nov 2009 08:25:38 PST

I have a file containing a snippet as below. The file will later be referenced with ui:include.

&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"&gt;
foo[b]&amp;nbsp;[/b]bar
&lt;/ui:composition&gt;

Result: "Error Parsing /snippets/header.xhtml: Error Traced[line: 3] The entity "nbsp" was referenced, but not declared."

It works fine if I change it to

&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"&gt;
foo[b]&amp;#160;[/b]bar
&lt;/ui:composition&gt;

Now, this was also the behavior of facelets in JSF 1.x, but I had been under the impression that it was a bug, not a feature. Is this the expected behavior in JSF 2.0? If so, why? And where does it say so in the spec?

I am using Mojarra 2.0.1 FCS with Java 6.0.15 and Tomcat 6.0.18.

Thanks!

- Marty
http://courses.coreservlets.com/public-courses/jsf2/
[Message sent by forum member 'martyhall' ]

http://forums.java.net/jive/thread.jspa?messageID=371739