portals-bridges-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sean Taylor (JIRA)" <bridges-...@portals.apache.org>
Subject [jira] Assigned: (PB-81) FilterPortlet bug when creating the PortletFilterChain
Date Fri, 04 Jul 2008 17:15:31 GMT

     [ https://issues.apache.org/jira/browse/PB-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

David Sean Taylor reassigned PB-81:
-----------------------------------

    Assignee: David Sean Taylor

> FilterPortlet bug when creating the PortletFilterChain
> ------------------------------------------------------
>
>                 Key: PB-81
>                 URL: https://issues.apache.org/jira/browse/PB-81
>             Project: Portals Bridges
>          Issue Type: Bug
>          Components: portletfilter
>    Affects Versions: 1.0.4
>         Environment: WebSphere Portal
>            Reporter: Alonso Dominguez
>            Assignee: David Sean Taylor
>            Priority: Minor
>
> I found that configuration of a FilterPortlet which has more than one filter can be bad
read at the constructor of the class FilterPortletChain. Following is the code that I found
at that class:
> String portletFilters = config.getInitParameter(PORTLET_FILTERS);
> StringTokenizer st = new StringTokenizer(portletFilters, ", ");
> while (st.hasMoreTokens())
> {
>      String className = st.nextToken();
>       try
>             {
>                 addPortletFilter(new PortletFilterConfig(className, config));
>             }
>             catch (PortletException e)
>             {
>                 log.warn("Invalid portlet filter: " + className, e);
>             }
> }
> As you can see, the StringTokenizer uses a two char string as a separator, so, when I
configure the filters for a given portlet, I need to put a blank after the comma (I think
that using just the comma as separator is enough). 
> Also, I have noticed that if I configure different PortletFilter classes in different
lines, The PortletFilterChain can only load the first one, when it tries to load the other
ones it throws a ClassNotFoundException. The cause of this is maybe that when iterating over
the tokens of the StringTokenizer there is not any call to the method "trim" from the class
String.
> Below is a suggestion of code that solves this issue:
> String portletFilters = config.getInitParameter(PORTLET_FILTERS);
>         StringTokenizer st = new StringTokenizer(portletFilters, ",");
>         while (st.hasMoreTokens())
>         {
>             String className = st.nextToken().trim();
>             try
>             {
>                 addPortletFilter(new PortletFilterConfig(className, config));
>             }
>             catch (PortletException e)
>             {
>                 log.warn("Invalid portlet filter: " + className, e);
>             }
>         }

-- 
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: bridges-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-dev-help@portals.apache.org


Mime
View raw message