Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-refactoring, 2.0.0
-
None
-
JDK 1.5.0_16, Tomcat 5.5.27
Description
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)
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.