[ 
http://issues.apache.org/jira/browse/GERONIMO-1759?page=comments#action_12412787
 ] 

Paul McMahan commented on GERONIMO-1759:
----------------------------------------

David, Aaron encountered the problem while adding images to the keystore 
portlet and he put this temporary workaround in place:

            if(index == -1) { // todo: Hack!  But this doesn't always work 
otherwise if invoked from a page that was invoked from another portlet instead 
of a page accessed by top-level navigation
                index = contextPath.indexOf(request.getPathInfo().substring(0, 
20));
            }

The problem with the workaround is that it hard codes the length of the console 
context and servlet path.  The workaround will stop working if/when they 
change, which may happen via GERONIMO-941.  The attached patch uses pattern 
matching instead of string length to determine the console framework's servlet 
path.

To see the original problem remove the workaround introduced by r388236, namely 
the lines shown above from PortletManager.java (395-397).   Then open the 
keystore portlet, click on "New Keystore" and then "Cancel".  The portlet will 
no longer display due to java.lang.StringIndexOutOfBoundsException: String 
index out of range: -1



> getConsoleFrameworkServletPath broken
> -------------------------------------
>
>          Key: GERONIMO-1759
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1759
>      Project: Geronimo
>         Type: Bug
>     Security: public(Regular issues) 
>   Components: console
>     Versions: 1.0
>     Reporter: Aaron Mulder
>     Assignee: Aaron Mulder
>      Fix For: 1.1, 1.2
>  Attachments: GERONIMO-1759.patch
>
> This function is used by the portlets to calculate the correct context path 
> to the portal so they can refer to images bundled with the portal WAR (as 
> opposed to bundled with the portlet WAR).
> It works fine on pages where you click a navigation link and land there.  It 
> does not seem to work if one portlet page has a form that submits to another 
> portlet page and the destination calls the function.
> In my case, it was looking for an occurance of:
> /Security/Security_keystores/_st_Security_keystores_row1_col1_p1/normal/_rp_Security_keystores_row1_col1_p1_mode/1_list/_ps_Security_keystores_row1_col1_p1/normal/_pm_Security_keystores_row1_col1_p1/view/_pid/Security_keystores_row1_col1_p1/_md_Security_keystores_row1_col1_p1/view
> in
> /console/portal/Security/Security_keystores/_st_Security_keystores_row1_col1_p1/normal/_ps_Security_keystores_row1_col1_p1/normal/_pm_Security_keystores_row1_col1_p1/view/_pid/Security_keystores_row1_col1_p1/_md_Security_keystores_row1_col1_p1/view
> And (if you look carefully) there is clearly none there.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to