Actually, this is illegal for JSR-168 as well. The spec says that the namespace needs to be valid whether it is prepended or appended to attribute names and id's. As for encodeNamespace, encoding attribute names is the whole purpose of this api. If JBoss Portal does this wrong, it's totally a problem with JBoss' portal.

Scott
Luca Castelluzzo wrote:
Hi,

I’ve had a problem with the automatically generated id attributes while
using JSF in a JBoss Portal portlet.

This JSF tag:

<h:form>

Becomes:

<form id="jbpns_2fores_2fUtilit&#224;_2f...[too long]" name="jbpns_2fores_2fUtilit&#224;_2f...[too long]" method="post" action="[omitted]" enctype="application/x-www-form-urlencoded">

Unfortunately, my portlet’s namespace contains an accented character "à"
which is perfectly legal for the JSR 168, but is illegal for an id attribute
in html. Actually, this character is converted to &#224; into the rendered
page, but this is illegal too.

I’ve done a search in MyFaces code and found the reason: these id attributes
are built by calling the encodeNamespace of PortletExternalContextImpl. This
method relies upon the JBoss Portal namespace:

return name + ((RenderResponse) _portletResponse).getNamespace();

I think I’ll solve the problem by manipulating the portlet’s namespace in
the encodeNamespace method.

I just want to make you aware of this issue. Thank you for your great job with MyFaces.

Luca


Reply via email to