I'm sending this to both the RI and facelets list because I'm not sure
who's problem it is. The following code does not work when using
JSF-RI 1.2 and Facelets.
<h:outputLink value="
http://www.google.com">
<f:param name="param1" value="20"/>
<f:param name="param2" value="30"/>
Some Link
</h:outputLink>
When that code is placed in Facelets I get an XML Parsing Error. The
Facelets xml parser is not handling the & that is written from the
h:outputLink. If I hardcode the anchor into my page like this:
<a href="
http://www.google.com?param1=20¶m2=30">
I get the same error. If I change the & to an entity reference &
then everything works fine. If I create a plain .html page with a
link using the entity reference & then the link appears to work
fine. So I figured that perhaps the RI should be writing an &
when rendering the outputLink instead of an &. However, doing a
search on the RI list found this bug
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=173 which
is addressing the same issue but for a graphicImage and directs the
graphicImage to output an & instead of an &. So the question is
should the RI be outputing & or &. Or should facelets be
processing the JSF generated xhtml differently?
Incidentally the xml spec says that the & in an attribute should be
escaped as an entity reference:
http://www.w3.org/TR/REC-xml/#dt-chardata
So how do we fix this?
Mike