Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

843844Nov 13 2009 — edited Nov 18 2009
I have a file containing a snippet with nbsp; (with an ampersand) as below. The file will later be referenced with ui:include.
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets">
foo&#38;nbsp;bar
</ui:composition>
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 #160; (with an ampersand) as here:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets">
foo&#38;#160;bar
</ui:composition>
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
[JSF 2.0 Training Courses|http://courses.coreservlets.com/public-courses/jsf2/]
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2009
Added on Nov 13 2009
3 comments
805 views