You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by Ralph Goers <Ra...@dslextreme.com> on 2004/12/03 19:02:03 UTC
PortletURLS
I am working at getting some JSR-168 portlets working properly in Cocoon
and I have run across some behavior which I am unsure if Cocoon is
handling it correctly. The code in the portlet JSP looks something like:
<%
PortletURL url = renderResponse.createActionURL();
url.setParameter("ACTION", "LINKS");
for (int i=0; i < links.size(); ++i)
{
String key = (String)links.get(i);
url.setParameter("LINK", key);
%>
<li><a href="<%url.toString()%>"><%=key%></a>
%>
}
In pluto's Portal this behaves OK, because Pluto adds the parameters as
request parameters on the link. In cocoon, all the links invoke the last
item. This is because Cocoon associates each link to an event and each
event ends up pointing to the same PortletURLProviderImpl. This contains
the last value for the link.
In reading the spec it is unclear to me that Cocoon is doing anything
wrong. It specifically says that a call to any of the setParameter methods
must replace any parameter with the same name previously set. However,
nowhere does it indicate that a call to toString() must cause a link to
invoke the url as it exists at that moment and, in fact, seems to imply
that it does not.
Opinions?
Ralph