JSF 2.0: Why is nbsp; Illegal in Included Files?
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&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&#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/]
BalusC wrote:
Facelets uses XHTML. XHTML is based on XML. HTML-style entities (&name;) are illegal in XML. You should use XML-style entities instead. Thus, use &#codepoint; instead wherein `codepoint` represents the unicode codepoint.I believe you are mistaken.
First of all, the XHTML 1.0 specification (http://www.w3.org/TR/xhtml1/) specifically says in section A.2 "the XHTML entity sets are the same as for HTML 4, ...". And, the spec uses "lt;", "gt;", "quot", and "euro;" (and probably more) within various parts of the spec. And, named character entities validate without error at http://validator.w3.org/ [Note that I deliberately left the ampersands off the front in the text above]
Second, nbsp; works fine in normal facelets pages. It is only in included pages where the current Mojarra implementation has problems.
After I posted my message, I got email from a JSF spec member who said it is a bug in the current implementation, and that I should report it. I did.
Cheers-
- Marty
[JSF 2.0 Training Courses|http://courses.coreservlets.com/public-courses/jsf2/]
Similar Messages
-
Tomcat 6.0.9 and jsf 1.2 and jstl 1.2 using *.tag file error
I using :tomcat 6.0.9 and jsf 1.2 and jstl 1.2
My web.xml is at version 2.5 and I am using a custom tag (with the .tag extension). I am trying to use the http://java.sun.com/jsf/html library and values from my attribute. I'm new to this so I figure I must just me missing something.
I am run http://192.168.1.1/test.jsf laster,view:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:212)
org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:576)
org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:50)
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:627)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:631)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:645)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:190)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:414)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:455)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:139)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.9 logs.
if go to /WEB-INF/tags/test.tag ,delete line: <h:outputText id="test" value="hello!" />
run http://192.168.1.1/test.jsf is OK!(no error),So I guess error for "<h:outputText id="test" value="hello!" />" line ,why in test.tag file do can't use the "http://java.sun.com/jsf/html " library,please help me.......
Here is file WEB-INF/web.xml content:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
version="2.5">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app>
Here is file /test.jsp code:
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
<html>
<head>
<title>test</title>
</head>
<body>
<!-- body start -->
<h:outputText id="myinfo" value="test success" />
<tags:test/>
<!-- body end -->
</body>
</html>
</f:view>
Here is file /WEB-INF/tags/test.tag code:
<%@tag pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<h:outputText id="test" value="hello!" />
Thanks for any help.Don't know if it's important, but there is no schema avaiable at: http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd
I found the right one at: http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
/perty
Message was edited by:
perajonsson -
Why can I not open PDF-files in InDesign CS4?
Hi,
Well then, as I wrote in the headline... Why can I not open PDF-files?
I get a notification that says that either the file is already open (which it's not) or it is missing a plug-in thingy for this kind of file.
So, how do I know which plug-in thing I should chose from Adobe which will solve my problem?
Could it be enough just to update the program? I tried with 6.0.6. upgrade but it wouldn't even open up. I'm not so good at this type of computerproblems (choosing upgrades, plug-in etc.). The program is not upgraded for a long time, unless it do it automatically, but I think we've chosen it not to....
Please help!
/SSee: Zanelli Multipage Importer
http://indesignsecrets.com/zanelli-releases-multipageimporter-for-importing-both-pdf-and-i ndd-files.php/comment-page-1 -
Why I cannot open raw files (NEF) from camera Nikon D3200 through Adobe Bridge and/or Photoshop ?
Thanks for the tip. It worked out perfectly.
De: ssprengel [email protected]
Enviada em: terça-feira, 14 de janeiro de 2014 19:14
Para: Aecio Paes Leme
Assunto: Why I cannot open camera raw files from camera Nikon 3200 through Adobe Bridge and/or Photoshop?
Re: Why I cannot open camera raw files from camera Nikon 3200 through Adobe Bridge and/or Photoshop?
created by ssprengel <http://forums.adobe.com/people/ssprengel> in Adobe Camera Raw - View the full discussion <http://forums.adobe.com/message/6012775#6012775 -
Why can't i open video file in photoshop cs5?
why can't i open video file in pts cs5?
i've already installed quick time but when i open video file, it appeared this
can you help me with this problem please?
ps: sorry for my bad English ToTWe need to know the exact source of the file and what system you're on. Could simply be an unresolvable compatibility issue/ unsupported format.
Mylenium -
I subscribed to Adobe PDF Pack, why can't I convert Pdf files to doc and/or jepg with my acrobat reader XI
I purchased the Pack three days ago, asked to sign in. when I try to sign in, I am led to a page to purchase the program.
What do I need to do to activate my subscribtion, so it will work with my reader XI?Hi helmutb86458194,
Did you have an update for us? Your response came through blank...
Best,
Sara -
Hi!
I think my question might be simple to answer, so please if you read this give it a try...
I just bought a new laptop with windows 7 on it. Adobe Reader 9 was allready installed. I wanted to open simple pdf files, but I got the message "Adobe Reader ?" in an empty field that pops up.
Why can't I open pdf files? Do I also need to install the Adobe Flash Player as well?
I would be very glad if you could give me a hint.
ThanxIt appears as if Adobe Reader is not correctly installed. Try installing the latest version 9.2 from http://get.adobe.com/reader/ - make sure that you uncheck any unwanted software bundled with the download.
P.S. no, you don't need Flash Player to open PDF files. -
Why can't i open raw files from my eos canon 7dii on PS elements 12
Why can't i open raw files from me eos canon 7dii on PS elements 12
Because your camera is newer than your software.
You need ACR 8.7 which was released this week, to open CR2 files from the 7D.2. Only current Adobe products can use this version, which would be PSE13 and the Photoshop versions CS6, CC & 2014 and some Adobe video products.
You can also use the free DNG Converter 8.7 to create DNGs of a folder of images at a time, and then open those DNGs in an older PSE version, but you’ll never be able to open the native CR2 files unless you update the host software to the current versions.
The DNG Converter 8.7 is available from the Adobe Updates page:
http://www.adobe.com/downloads/updates -
Why is my word and pdf files so large? How can I reduce the size?
My document contains mostly photos from a database via a path to the actual jpeg photos on disk.
There are 39 jpeg photos + a small amount of text with each photo.
The 39 jpeg photos on the disk add up to be 5.79 mb.
If I export the crystal reports document as [Microsoft Word (97-2003) Non Editable] the, the file size is 36.8 mb.
If I export the same data as a [Microsoft Word (97-2003) Editable] the file size is only 3.1 mb.
That is a difference of 33.7 mb! Why?
Also, when I export the same data to a PDF file it is much larger than I think it should be; 12.7 mb.
Why is my word and PDF files so large?
How can I reduce the size of the word and PDF files? (without reducing the photo quality).
Are there any tools to post process the Word or PDF files to reduce the file size?You can't, extra size is to hold the details
-
Why can't I open pdf file? Get a black box with a white x in the upper left hand corner that won't open either
I get the same thing... no matter what site i try to pull a pdf for IE10, it gives me the black x... if i use chrome it works, but my client does not want to use a different browser.
I followed the guide that Pat posted... nothing worked... I have uninstalled and reinstalled Java, Adobe reader, Adobe flash,.. upgraded to IE11, then back to IE10 due to medical software that is not compatable with IE11...
The kicker is that my Admin profile works just fine.. no issues.. so i know it has something to do with his profile....
Please.. someone... help!!! -
Why can't I open PDF files created in Adobe X using Adobe XI? How do I fix this?
Why can't I open PDF files created using Adobe X in Adobe XI?
I try and open them in Reader (double left click on the file) and all I get is a single screen with two overlapping frames neither of which have anything to do with the subject although the presentation title is at the top. One of the frames had "Adobemail.com" on it. Our work computers were recently up-graded to Adobe XI and this was the first time I tried to open a presentation that has worked fine in the past. I would have thought that Adobe XI would have been backward compatible, but it doesn't seem so. Any help would be greatly appreciated as I have an 08:00 First-Aid class tomorrow and need this presentation. Apparently Adobe forums are off-line for up-grades. Thanks
[private data removed] -
Why i cannot open a PDF file even with abobe 9
why i cannot open a PDF file even with abobe 9
Please supply screen shot when it is asking for updates. (Do not send as email, use CAMERA icon). This is important, there are many fake updates.
-
Why can I not attach multiple files on iPad ???
Why does iPad not allow multiple files to be attached. This is one of the very basic feature all computers must have...why is apple trying to complicate the like of people without this simple feature ???????
Please add this feature in your iOS updates...this is jut crazy !!!!!!We are just other users here. Apple does not read these posts for your suggestions or complaints. Suggest it here.
http://www.apple.com/feedback/ipad.html
BTW - the iPad is not a computer and was not designed - at least to this point - to totally take the place of a computer. There are other email apps available as well that may suit your needs - MailShot or Group Email with attachments. Check those out - see if they allow for multiple file attachments. -
Why can I not import aif files to garage band?
Once I have created an aiff file in iTunes, why can I not import those files into Garage Band? I'd like to be able to edit some of those files.
I go to garage band and click on create a new project, then browse through the finder and files I want to import are all grayed out -- aiff AND wav files.
You first need to create a new project - in the "new Project panel" select a template (Guitar, piano, ...), not "Open an existing file".
When the project window opens, drag your aiff or wav file onto an empty space in the Timeline, or open the Media Browser from the footer bar in GarageBand and import an aiff song from your iTunes Library.
Regards
Léonie -
Why can I highlight some pdf files and not others
Why can I highlight some pdf files and not others
Highlighting only works on text documents; a scanned document (image) cannot be highlighted.
Maybe you are looking for
-
My Creative Zen Nano Plus doesn't switch
First when I purchased this Mp3-player it worked quite well, but when I tried to change battery when the old one was empty, it didn't work anymore. I can't switch it on. I wonder if it's because of that I tried different battery than the one I get wi
-
Settings don't have MTU settings for Xbox Live
I've been having problems connecting to Xbox Live. All of my PCs wired and wireless can connect to the internet except for my 2 Xbox 360s one wired and one wireless. Some times it says that there isn't enough MTU or can't connect to the network when
-
In LV6.1, can I get the run-time menu refnum of a VI from the VI Path?
Actually, for any version of LabVIEW, can I get the run-time menu refnum from the VI Path (or the VI reference)? Thanks! Enrique www.vartortech.com
-
Can't execute javascript via URL Bar
https://support.mozilla.com/en-US/questions/871548 I suffer from this, the solution to use a bookmark works however I want to know how and what changes prevent the use of the URL Bar for such things. Sometimes Firefox will respond to it being pasted
-
Im a beginner at flash and my english isnt that good eather but i'll give it a shot. I know that you can add new properties in a variable like i'll show in the first part. But is there anyway that i can do it as i will show in the second part?