Re: Problems with & handling between RI and Facelets

From: Adam Winer <>
Date: Fri, 28 Jul 2006 13:04:51 -0700

Whatever the spec says, the proper behavior is that both h:graphicImage
and h:outputLink should be calling ResponseWriter.encodeURIAttribute(),
which on HTML (but not XHTML) does not need to encode '&'.

-- Adam

Michael Youngstrom wrote:
>> Not that I'm aware of. The Renderkit docs are clear that '&' is
>> not to be encoded
>> <quote>
>> Renders an HTML "img" element. Render the clientId as the value of the
>> "id" attribute. Render the value of the component as the value of the
>> "src" attribute, after passing it to the getResourceURL() method of the
>> ViewHandler for this application, and passing the result through the
>> encodeResourceURL() method of the ExternalContext. When handling the
>> "src" attribute, the value must not be escaped. For example, & must not
>> be turned into &amp;. If the "styleClass" attribute is specified, render
>> its value as the value of the "class" attribute.
>> </quote>
> My original question is with the encoding of the & for an outputLink.
> I looked at the outputLink renderDocs and no comments on & are made so
> perhaps outputLink could always render an &amp;? Though it would be
> interesting to know the history of that comment on the graphicImage
> renderKit docs
> On the graphicImage side of things I'm a little concerned that if
> implemented so an & is always returned then the graphicImage component
> will never produce valid xml when 2 parameters are used. Perhaps the
> renderKit docs can be interpereted in a way that if the user specified
> & in the url attribute then that will never be converted to an &amp;
> But if the user specifies &amp; in the src perhaps the renderer can
> just pass it through?
> Mike
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail: