You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Brian DeHamer (JIRA)" <ji...@apache.org> on 2008/10/07 19:46:46 UTC

[jira] Created: (PLUTO-507) PortalDriverFilter doesn't handle action requests properly, throws IllegalStateException

PortalDriverFilter doesn't handle action requests properly, throws IllegalStateException
----------------------------------------------------------------------------------------

                 Key: PLUTO-507
                 URL: https://issues.apache.org/jira/browse/PLUTO-507
             Project: Pluto
          Issue Type: Bug
          Components: portal driver
    Affects Versions: 2.0.0, 2.0-refactoring
         Environment: JDK 1.5.0_16, Tomcat 5.5.27
            Reporter: Brian DeHamer
             Fix For: 2.0.0, 2.0-refactoring


Action requests targeted at a portlet which is rendered via the PortalDriverFilter are not handled properly.  The PortalDriverFilter should return immediately after handling an incoming action request since the end result of an action request is to issue a redirect to the client's browser.  As currently implemented, the PortalDriverFilter does NOT return after an action request resulting in the following exception:

java.lang.IllegalStateException: Cannot forward after response has been committed
	org.apache.pluto.driver.PortalDriverFilter.doFilter(PortalDriverFilter.java:125)

There is logic in the PortalDriverFilter that attempts to determine if the current request is an action request and will immediately return if an action request is detected; however, the logic that is being used to test for an action request is incorrect.

The following block of code is used to detect an action request (lines 110-113)

    PortalURL url = ctx.getRequestedPortalURL();
    if (url.getActionWindow() != null) {
        return;
    }

Note that the call to getActionWindow() will ALWAYS return null after an action request has been handled (there is logic in the PortletContainerImpl that sets this value to null during the processing of the action request).  Since getActionWindow() always returns null, the return statement is never executed.  The subsequent invocation of the forward() method on the RequestDispatcher() (line 125) causes the IllegalStateException since a redirect has already been sent to the client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PLUTO-507) PortalDriverFilter doesn't handle action requests properly, throws IllegalStateException

Posted by "Brian DeHamer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PLUTO-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian DeHamer updated PLUTO-507:
--------------------------------

    Attachment: patch-507.txt

The attached patch represents a refactoring of the PortalDriverFilter class which ensures that action requests are properly detected and the filter exits immediately after the handling those requests.

> PortalDriverFilter doesn't handle action requests properly, throws IllegalStateException
> ----------------------------------------------------------------------------------------
>
>                 Key: PLUTO-507
>                 URL: https://issues.apache.org/jira/browse/PLUTO-507
>             Project: Pluto
>          Issue Type: Bug
>          Components: portal driver
>    Affects Versions: 2.0.0, 2.0-refactoring
>         Environment: JDK 1.5.0_16, Tomcat 5.5.27
>            Reporter: Brian DeHamer
>             Fix For: 2.0.0, 2.0-refactoring
>
>         Attachments: patch-507.txt
>
>
> Action requests targeted at a portlet which is rendered via the PortalDriverFilter are not handled properly.  The PortalDriverFilter should return immediately after handling an incoming action request since the end result of an action request is to issue a redirect to the client's browser.  As currently implemented, the PortalDriverFilter does NOT return after an action request resulting in the following exception:
> java.lang.IllegalStateException: Cannot forward after response has been committed
> 	org.apache.pluto.driver.PortalDriverFilter.doFilter(PortalDriverFilter.java:125)
> There is logic in the PortalDriverFilter that attempts to determine if the current request is an action request and will immediately return if an action request is detected; however, the logic that is being used to test for an action request is incorrect.
> The following block of code is used to detect an action request (lines 110-113)
>     PortalURL url = ctx.getRequestedPortalURL();
>     if (url.getActionWindow() != null) {
>         return;
>     }
> Note that the call to getActionWindow() will ALWAYS return null after an action request has been handled (there is logic in the PortletContainerImpl that sets this value to null during the processing of the action request).  Since getActionWindow() always returns null, the return statement is never executed.  The subsequent invocation of the forward() method on the RequestDispatcher() (line 125) causes the IllegalStateException since a redirect has already been sent to the client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (PLUTO-507) PortalDriverFilter doesn't handle action requests properly, throws IllegalStateException

Posted by "Craig Doremus (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PLUTO-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Doremus closed PLUTO-507.
-------------------------------

    Resolution: Fixed

Patch applied in SVN rev 702808 and 702809 to trunk and 2.0-refactoring branch.

> PortalDriverFilter doesn't handle action requests properly, throws IllegalStateException
> ----------------------------------------------------------------------------------------
>
>                 Key: PLUTO-507
>                 URL: https://issues.apache.org/jira/browse/PLUTO-507
>             Project: Pluto
>          Issue Type: Bug
>          Components: portal driver
>    Affects Versions: 2.0.0, 2.0-refactoring
>         Environment: JDK 1.5.0_16, Tomcat 5.5.27
>            Reporter: Brian DeHamer
>             Fix For: 2.0.0, 2.0-refactoring
>
>         Attachments: patch-507.txt
>
>
> Action requests targeted at a portlet which is rendered via the PortalDriverFilter are not handled properly.  The PortalDriverFilter should return immediately after handling an incoming action request since the end result of an action request is to issue a redirect to the client's browser.  As currently implemented, the PortalDriverFilter does NOT return after an action request resulting in the following exception:
> java.lang.IllegalStateException: Cannot forward after response has been committed
> 	org.apache.pluto.driver.PortalDriverFilter.doFilter(PortalDriverFilter.java:125)
> There is logic in the PortalDriverFilter that attempts to determine if the current request is an action request and will immediately return if an action request is detected; however, the logic that is being used to test for an action request is incorrect.
> The following block of code is used to detect an action request (lines 110-113)
>     PortalURL url = ctx.getRequestedPortalURL();
>     if (url.getActionWindow() != null) {
>         return;
>     }
> Note that the call to getActionWindow() will ALWAYS return null after an action request has been handled (there is logic in the PortletContainerImpl that sets this value to null during the processing of the action request).  Since getActionWindow() always returns null, the return statement is never executed.  The subsequent invocation of the forward() method on the RequestDispatcher() (line 125) causes the IllegalStateException since a redirect has already been sent to the client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.