You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bridges-dev@portals.apache.org by "David Sean Taylor (JIRA)" <br...@portals.apache.org> on 2008/07/04 19:15:48 UTC
[jira] Work started: (PB-81) FilterPortlet bug when creating the
PortletFilterChain
[ https://issues.apache.org/jira/browse/PB-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on PB-81 started by 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