Skip to main content

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

6 replies [Last post]
martyhall
Offline
Joined: 2009-08-19
Points: 0

I have a file containing a snippet 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&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

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets">
foo&#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
http://courses.coreservlets.com/public-courses/jsf2/

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jim Driscoll

This is fixed in 2.0.2 - try that build.

Sent from my iPhone

On Nov 13, 2009, at 8:25 AM, webtier@javadesktop.org wrote:

> I have a file containing a snippet 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[b]&nbsp;[/b]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
>
> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets
> ">
> foo[b]&#160;[/b]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
> http://courses.coreservlets.com/public-courses/jsf2/
> [Message sent by forum member 'martyhall' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=371739
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

martyhall
Offline
Joined: 2009-08-19
Points: 0

> Jim Driscoll wrote:
> This is fixed in 2.0.2 - try that build.

Hmm. The nightly build? I just grabbed https://javaserverfaces.dev.java.net/files/documents/1866/144500/mojarra..., replaced the two JAR files in my app with the two from this file, shut down the server, redeployed, and re-ran.The startup message said "INFO: Initializing Mojarra 2.0.2 (SNAPSHOT 20091113) for context '/page-templating' "

Yet, I get the same error as before: "Error Parsing /snippets/header.xhtml: Error Traced[line: 6] The entity "nbsp" was referenced, but not declared." If I change to #160; (with an ampersand in front), it works fine.

Did I grab the right build?

Cheers-
- Marty

http://courses.coreservlets.com/public-courses/jsf2/

Jim Driscoll

Sorry Marty - I didn't read your bug carefully enough.

Sounds like a new bug - could you file it please?

Jim

On 11/13/09 10:59 AM, webtier@javadesktop.org wrote:
>> Jim Driscoll wrote:
>> This is fixed in 2.0.2 - try that build.
>
> Hmm. The nightly build? I just grabbed https://javaserverfaces.dev.java.net/files/documents/1866/144500/mojarra..., replaced the two JAR files in my app with the two from this file, shut down the server, redeployed, and re-ran.The startup message said "INFO: Initializing Mojarra 2.0.2 (SNAPSHOT 20091113) for context '/page-templating' "
>
> Yet, I get the same error as before: "Error Parsing /snippets/header.xhtml: Error Traced[line: 6] The entity "nbsp" was referenced, but not declared." If I change to #160; (with an ampersand in front), it works fine.
>
> Did I grab the right build?
>
> Cheers-
> - Marty
>
> http://courses.coreservlets.com/public-courses/jsf2/
> [Message sent by forum member 'martyhall' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=371766
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

martyhall
Offline
Joined: 2009-08-19
Points: 0

> Jim Driscoll wrote:
> Sorry Marty - I didn't read your bug carefully enough.
>
> Sounds like a new bug - could you file it please?

OK, thanks. My main reason for posting is that I wasn't sure if it [b]was [/b]a bug. Every version of facelets I ever tried in JSF 1.[i]x[/i] had the same behavior, so when I saw this behavior in JSF 2.0, I was wondering if somehow this was a feature instead of a bug.

I'll file it now. Thanks again; I [i]really [/i]appreciate all the useful feedback and help in this forum.

Cheers-

- Marty
http://www.coreservlets.com/JSF-Tutorial/jsf2/

bria526
Offline
Joined: 2006-05-16
Points: 0

Hi Jim, Marty,
Has this been fixed, and if so at which point (build/release)?
Cheers,
MB

ceefour
Offline
Joined: 2007-04-06
Points: 0

Over two years later and still not fixed :-(

http://java.net/jira/browse/JAVASERVERFACES-1576