The issue would be that MyFaces is creating an HtmlResponseWriter
even though it's not HTML.  Hard to blame it, though.  The general
intent here is for XML-type languages.

In this scenario, I'd probably recommend that Facelets
specifically intercept text/css and text/plain to create
an internal PlainTextResponseWriter, one that throws
exceptions on calls to startElement(), for example, but
passes writeText() straight to write().

-- Adam


On 6/29/07, Safurudin Mahic <[EMAIL PROTECTED]> wrote:
I'm trying to get facelets to render my css files (especially neet to
get the url(#{facesContext.ex

Reccomended by some of the guys on the facelets mailing list, I first tried
to do <f:view contentType="text/css">...</f:view>
This went badly, because the html renderer kit for myfaces doesn't
support this contentType. It only support a small set of content types
defined;
private static String HTML_CONTENT_TYPE = "text/html";
private static String TEXT_ANY_CONTENT_TYPE = "text/*";
private static String ANY_CONTENT_TYPE = "*/*";
private static String APPLICATION_XML_CONTENT_TYPE = "application/xml";
private static String TEXT_XML_CONTENT_TYPE = "text/xml";
private static String XHTML_CONTENT_TYPE = "application/xhtml+xml";

Tried then to use the */* - this went OK - the problem now however is
that either facelets or
myfaces escapes special characters in the css files:

The following perfecly valid css selector:

h2 {
font-family: Arial, "Arial CE", "Lucida Grande CE", lucida,
"Helvetica CE", sans-serif;
}

is escaped with

h2 {
font-family: Arial, &quot;Arial CE&quot;, &quot;Lucida Grande CE&quot;,
lucida,
&quot;Helvetica CE&quot;, sans-serif;
}

rendering the generated css as invalid

Is there a way to turn off html entity character escaping for a
particular view?

Thanks,
Safurudin Mahic


Reply via email to