You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2021/12/16 02:54:00 UTC

[portals-pluto] branch master updated: PLUTO-781 PortletRequestDispatcherImpl forwards to incorrect path

This is an automated email from the ASF dual-hosted git repository.

asfgriff pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/portals-pluto.git


The following commit(s) were added to refs/heads/master by this push:
     new b06210f  PLUTO-781 PortletRequestDispatcherImpl forwards to incorrect path
b06210f is described below

commit b06210fa513c25503607204c7df56e728093bf92
Author: Neil Griffin <ne...@gmail.com>
AuthorDate: Wed Dec 15 21:53:58 2021 -0500

    PLUTO-781 PortletRequestDispatcherImpl forwards to incorrect path
---
 .../container/impl/HttpServletPortletRequestWrapper.java  | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
index 3031597..210acdd 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
@@ -31,6 +31,7 @@ import java.util.Map;
 
 import javax.portlet.ClientDataRequest;
 import javax.portlet.HeaderRequest;
+import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.portlet.RenderRequest;
@@ -374,7 +375,19 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       de.type = Type.FWD;
       de.qparms = processPath(path);
       dispatches.add(de);
-      isMethSpecialHandling = true;       //!isForwardingPossible(); (logical, but not to spec)
+      isMethSpecialHandling = true;
+
+      // PLUTO-781
+      PortletConfig portletConfig = reqctx.getPortletConfig();
+      String initParameter = portletConfig.getInitParameter("org.apache.pluto.enable.nested.resource.forwards");
+      if ("true".equalsIgnoreCase(initParameter)) {
+         // Note: When isMethSpecialHandling is false, it causes failures
+         // in the following Portlet 3.0 TCK tests:
+         // V2DispatcherTests5_SPEC2_19_IncThenForwardServletResource_invoke7
+         // V2DispatcherTests6_SPEC2_19_FwdThenForwardServletResource_invoke7
+         isMethSpecialHandling = !isForwardingPossible(); // (logical, but not to spec)
+      }
+
       isAttrSpecialHandling = true;
       
       reqctx.startDispatch(this, de.qparms, phase);