[
https://issues.apache.org/jira/browse/PB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12640533#action_12640533
]
Antony Stubbs commented on PB-84:
---------------------------------
Ok, the new code that you posted seems to do better, but I seem to have a
problem where
{code}
portletWindowId = nameRef[0].substring("javax.portlet.p.".length(),
nameRef[0].indexOf('?'));
{code}
throws StringIndexOutOfBoundsException, because the value of nameRef[0] comes
back just as PORTLET_WINDOW_ID
i.e. "org.apache.portals.bridges.util.portlet_window_id" not
"javax.portlet.p.*" as the code implies
{code}
getPortletWindowId for session: CC465B39BA9199712DEEF690F90AE2C2 (thread: 15)
no portletWindowId yet - going to derive it.
17/10/2008 15:44:23 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -17
{code}
> CCE in PortletWindowUtils.getPortletWindowId
> --------------------------------------------
>
> Key: PB-84
> URL: https://issues.apache.org/jira/browse/PB-84
> Project: Portals Bridges
> Issue Type: Bug
> Components: common
> Affects Versions: 1.0
> Environment: Mac OS, Wicket Portlets, OpenPortal Portlet Container
> Reporter: Tim Boudreau
> Attachments: portals-bridges-common-1.0.4.jar
>
>
> I'm trying to get wicket portlet support working over OpenPortal. I've
> hacked together implementations of ServletContextProvider and
> PortletResourceURLFactory - just required exposing WicketFilter from the
> Application to get the necessary data. I can deploy a portlet, but...
> I'm getting this exception.
> java.lang.ClassCastException: java.lang.Double
> at
> org.apache.portals.bridges.util.PortletWindowUtils.getPortletWindowId(PortletWindowUtils.java:45)
> Looking at the code, this seems like a clear bug: The method casts to String
> here:
> (String)session.getAttribute(PORTLET_WINDOW_ID);
> and if null fills in the value with an instance of Double. If it's going to
> put a Double there, it should probably not expect a String - this exception
> will occur any time this method is called twice for a PortletSession, it will
> throw the CCE the second time it is called.
> Since the value is not used, probably simply changing it to
> Object portletWindowId = session.getAttribute(PORTLET_WINDOW_ID);
> would fix it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]