- assigned_to: nobody --> cagatay_civici
First I would like to say great job. I was putting off
writing something like this myself.
Of course the minute after I got the example war
working it tried to use this in my portlets and ran
into url issues.
The issue starts with this line in UIChart:
writer.writeAttribute("src", path +
"/servlet/Chartlet?id=" + id, null);
The portal will modify the id attribute to include
portlet instance information. As a result the Chartlet
wont be able to find the ChartData in the session.
I looked for a JSF api that would handle this, but
didn't find anything. So, I made a change in Chartlet
that at least works in JBoss Portal without coupling it
to JBoss.
Here is the change:
doGet(...) {
...
ChartData chartData = getChartData(session, id);
...
}
private ChartData getChartData(
HttpSession session,
String id)
{
Enumeration i = session.getAttributeNames();
while (i.hasMoreElements()) {
String name = (String)i.nextElement();
if (name.contains(id)) {
return (ChartData) session.getAttribute(name);
}
}
return null;
}