I’m working on a JSF 2 web application. If I define a facelet that begins as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd"[
<!ENTITY nbsp " ">
<!ENTITY pound "£">
]>
<html
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<h:head>
When rendered as HTML the entity definitions have been removed. Is there a way to preserve them if I really want them included in the output markup?
I don’t know if you can write a new renderer also, but i had a similar problem with responding an XML result.
In my case i grabbed the HttpOutputStream in the Backing Bean and wrote the XML. Maybe if you skip the close and ctx.responseComplete() from my example, JSF normally writes his response in the stream.