portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [8/9] portals-pluto git commit: Refactoring to allow the query string parameters set during a request dispatcher nclude or forward to be available through the V3 parameter handling APIs and to be available for copying to URLs during render and resource r
Date Mon, 02 May 2016 14:03:34 GMT
Refactoring to allow the query string parameters set during a request
dispatcher nclude or forward to be available through the V3 parameter
handling APIs and to be available for copying to URLs during render and
resource requests. fixed bug in query string parameter support during
nested includes / forwards. Reduced log levl from debug to trace to makes
the logs less verbose during general processing.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/e72ed5fa
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/e72ed5fa
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/e72ed5fa

Branch: refs/heads/master
Commit: e72ed5fa08e3691901e4cdc7e1601f416dc825d8
Parents: 351e4c4
Author: Scott Nicklous <msnicklous@apache.org>
Authored: Sun May 1 15:35:21 2016 +0200
Committer: Scott Nicklous <msnicklous@apache.org>
Committed: Sun May 1 15:35:21 2016 +0200

----------------------------------------------------------------------
 .../org/apache/portals/samples/PathDisplay.java | 10 +--
 .../portals/samples/PathDisplayServlet.java     |  2 +-
 .../apache/portals/samples/PathInfoPortlet.java | 14 ++--
 .../src/main/webapp/WEB-INF/jsp/pathinfo.jsp    | 11 +--
 .../pluto/container/PortletRequestContext.java  |  2 +
 .../container/PortletRequestContextService.java | 57 +++++++--------
 .../pluto/container/impl/BaseURLImpl.java       |  4 +-
 .../impl/HttpServletPortletRequestWrapper.java  | 77 +++-----------------
 .../container/impl/PortletContainerImpl.java    | 14 ++--
 .../impl/PortletRequestDispatcherImpl.java      | 12 +--
 .../PortletActionResponseContextImpl.java       |  5 +-
 .../PortletEventResponseContextImpl.java        |  5 +-
 .../PortletHeaderResponseContextImpl.java       |  5 +-
 .../PortletMimeResponseContextImpl.java         |  5 +-
 .../PortletRenderResponseContextImpl.java       |  5 +-
 .../container/PortletRequestContextImpl.java    | 39 +++++++++-
 .../PortletRequestContextServiceImpl.java       | 20 ++---
 .../PortletResourceResponseContextImpl.java     |  5 +-
 .../container/PortletResponseContextImpl.java   | 16 +++-
 .../PortletStateAwareResponseContextImpl.java   |  8 +-
 .../container/PortletURLProviderImpl.java       |  9 ++-
 .../driver/url/impl/RelativePortalURLImpl.java  |  5 +-
 .../org/apache/pluto/driver/url/PortalURL.java  |  3 +-
 .../driver/url/PortletParameterFactory.java     | 45 ++++--------
 24 files changed, 182 insertions(+), 196 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplay.java
----------------------------------------------------------------------
diff --git a/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplay.java b/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplay.java
index 0dbc4ba..e2ba472 100644
--- a/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplay.java
+++ b/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplay.java
@@ -225,7 +225,7 @@ public class PathDisplay {
       txt.append("<td>getQueryString:</td><td>").append(method_query_string).append("</td>\n");
       txt.append("</tr><tr><td style='padding-top:8px;'/></tr><tr>");
 
-      txt.append("<td>Combined Params:</td><td>");
+      txt.append("<td>Combined Params:</td>");
       for (String key : params.keySet()) {
          txt.append("</tr><tr>");
          txt.append("<td style='padding-left:8px;'>").append(key).append("</td><td>");
@@ -233,9 +233,9 @@ public class PathDisplay {
       }
       txt.append("</tr><tr><td style='padding-top:8px;'/></tr><tr>");
 
-      txt.append("<td>Render Params:</td><td>");
+      txt.append("<td>Render Params:</td>");
       if (renParams.isEmpty()) {
-         txt.append("<td style='padding-left:8px;'>(none)</td><td>");
+         txt.append("<td style='padding-left:8px;'>(none)</td>");
       } else {
          for (String key : renParams.keySet()) {
             txt.append("</tr><tr>");
@@ -245,9 +245,9 @@ public class PathDisplay {
       }
       txt.append("</tr><tr><td style='padding-top:8px;'/></tr><tr>");
 
-      txt.append("<td>Resource Params:</td><td>");
+      txt.append("<td>Resource Params:</td>");
       if (resParams.isEmpty()) {
-         txt.append("<td style='padding-left:8px;'>(none)</td><td>");
+         txt.append("<td style='padding-left:8px;'>(none)</td>");
       } else {
          for (String key : resParams.keySet()) {
             txt.append("</tr><tr>");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplayServlet.java
----------------------------------------------------------------------
diff --git a/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplayServlet.java b/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplayServlet.java
index 8fc3ac4..5814095 100644
--- a/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplayServlet.java
+++ b/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathDisplayServlet.java
@@ -39,7 +39,7 @@ import javax.servlet.http.HttpServletResponse;
 public class PathDisplayServlet extends HttpServlet {
    private static final long serialVersionUID = -7767947528599563527L;
 
-   private static final String JSP = "/WEB-INF/jsp/pathinfo.jsp?mix1=svltval1&qp10=svltval2&mix2=svltval3";
+   private static final String JSP = "/WEB-INF/jsp/pathinfo.jsp?mix1=svtqval1&svtqp3=svtqval3&mix2=svtqval2";
 
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathInfoPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathInfoPortlet.java b/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathInfoPortlet.java
index a0c7cac..fe48507 100644
--- a/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathInfoPortlet.java
+++ b/PortletV3AnnotatedDemo/src/main/java/org/apache/portals/samples/PathInfoPortlet.java
@@ -47,8 +47,8 @@ public class PathInfoPortlet {
 
    public static final String RESPARAM_DISPLAY = "display";
 
-   private static final String JSP = "/WEB-INF/jsp/pathinfo.jsp?mix1&qp1=qval2&mix2=qval3";
-   private static final String SERVLET = "/Named/Bob/Some/Path/Info?mix1&qp1=qval2&mix2=qval3";
+   private static final String JSP = "/WEB-INF/jsp/pathinfo.jsp?mix1&qp1=qval1&mix2=qmix2";
+   private static final String SERVLET = "/Named/Bob/Some/Path/Info?mix1&qp1=qval1&mix2=qmix2";
    private static final String NAME = "Bob";
 
    // Injecting the namespace & URLFactory
@@ -76,8 +76,8 @@ public class PathInfoPortlet {
          PortletURL rurl = resp.createRenderURL();
          MutableRenderParameters rp = rurl.getRenderParameters().clone();
          rp.setValue("renp1", "renval1");
-         rp.setValue("mix2", "renval2");
-         rp.setValue("mix1", "renval3");
+         rp.setValue("mix2", "renmix2");
+         rp.setValue("mix1", "renmix1");
          rp.setValue("op", "inc");
          rurl.getRenderParameters().set(rp);
          RenderLink tl = new RenderLink("Resource include", rurl);
@@ -121,8 +121,8 @@ public class PathInfoPortlet {
          PortletURL cntlurl = resp.createRenderURL();
          MutableRenderParameters rp = cntlurl.getRenderParameters();
          rp.setValue("renp1", "renval1");
-         rp.setValue("mix2", "renval2");
-         rp.setValue("mix1", "renval3");
+         rp.setValue("mix2", "renmix2");
+         rp.setValue("mix1", "renmix1");
          rp.setValue("op", "inc");
 
          if (op.equals("fwd")) {
@@ -143,6 +143,8 @@ public class PathInfoPortlet {
             pd = new PathDisplay(req, "Render Method (After)");
             writer.write(pd.toMarkup());
          } else if (op.equals("fwdjsp")) {
+            RenderLink renlink = new RenderLink("back", cntlurl);
+            req.setAttribute("renderLink", renlink);
             req.setAttribute("jsptitle", "Forwarded by render method.");
             PortletRequestDispatcher rd = pcfg.getPortletContext().getRequestDispatcher(JSP);
             rd.forward(req, resp);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/jsp/pathinfo.jsp
----------------------------------------------------------------------
diff --git a/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/jsp/pathinfo.jsp b/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/jsp/pathinfo.jsp
index 54f1f0f..158323f 100644
--- a/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/jsp/pathinfo.jsp
+++ b/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/jsp/pathinfo.jsp
@@ -9,6 +9,12 @@
 <div class='bluebox'>
 <p>${jsptitle}</p>
 <%
+
+RenderLink rl = (RenderLink) request.getAttribute("renderLink");
+if (rl != null) {
+   out.append(rl.toString());
+}
+
 ArrayList<String> pathInfo = (ArrayList<String>) request.getAttribute("pathInfo");
 if (pathInfo != null) {
    for (String item : pathInfo) {
@@ -16,11 +22,6 @@ if (pathInfo != null) {
    }
 }
 
-RenderLink rl = (RenderLink) request.getAttribute("renderLink");
-if (rl != null) {
-   out.append(rl.toString());
-}
-
 PathDisplay pd = new PathDisplay(request, "JSP (ServletRequest)");
 out.append(pd.toMarkup());
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
index 22c1e79..83dbe4a 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
@@ -94,4 +94,6 @@ public interface PortletRequestContext
     // To provide special handling during portlet request dispatcher and async dispatches
     void endDispatch();
     void startDispatch(HttpServletRequest wrappedServletRequest, Map<String, List<String>> queryParams, String phase);
+    Map<String, List<String>> getQueryParams();
+    String getPhase();
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
index 15643e6..6f84473 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
@@ -19,47 +19,44 @@ package org.apache.pluto.container;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-
 /**
  * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
  * @version $Id$
  */
-public interface PortletRequestContextService
-{
-    PortletRequestContext getPortletActionRequestContext(PortletContainer container, HttpServletRequest containerRequest,
-                                                         HttpServletResponse containerResponse, PortletWindow window);
+public interface PortletRequestContextService {
+   PortletRequestContext getPortletActionRequestContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window);
 
-    PortletRequestContext getPortletEventRequestContext(PortletContainer container, HttpServletRequest containerRequest,
-                                                        HttpServletResponse containerResponse, PortletWindow window);
+   PortletRequestContext getPortletEventRequestContext(PortletContainer container, HttpServletRequest containerRequest,
+         HttpServletResponse containerResponse, PortletWindow window);
 
-    PortletResourceRequestContext getPortletResourceRequestContext(PortletContainer container,
-                                                                   HttpServletRequest containerRequest,
-                                                                   HttpServletResponse containerResponse, 
-                                                                   PortletWindow window,
-                                                                   String pageState);
+   PortletResourceRequestContext getPortletResourceRequestContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window,
+         String pageState);
 
-    PortletRequestContext getPortletHeaderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
-                                                         HttpServletResponse containerResponse, PortletWindow window);
+   PortletRequestContext getPortletHeaderRequestContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window);
 
-    PortletRequestContext getPortletRenderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
-                                                         HttpServletResponse containerResponse, PortletWindow window);
+   PortletRequestContext getPortletRenderRequestContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window);
 
-    PortletActionResponseContext getPortletActionResponseContext(PortletContainer container,
-                                                                 HttpServletRequest containerRequest,
-                                                                 HttpServletResponse containerResponse, PortletWindow window);
+   PortletActionResponseContext getPortletActionResponseContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, 
+         PortletWindow window, PortletRequestContext requestContext);
 
-    PortletEventResponseContext getPortletEventResponseContext(PortletContainer container, HttpServletRequest containerRequest,
-                                                               HttpServletResponse containerResponse, PortletWindow window);
+   PortletEventResponseContext getPortletEventResponseContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, 
+         PortletWindow window, PortletRequestContext requestContext);
 
-    PortletResourceResponseContext getPortletResourceResponseContext(PortletContainer container,
-                                                                     HttpServletRequest containerRequest,
-                                                                     HttpServletResponse containerResponse, PortletWindow window);
+   PortletResourceResponseContext getPortletResourceResponseContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, 
+         PortletWindow window, PortletRequestContext requestContext);
 
-    PortletRenderResponseContext getPortletRenderResponseContext(PortletContainer container,
-                                                                 HttpServletRequest containerRequest,
-                                                                 HttpServletResponse containerResponse, PortletWindow window);
+   PortletRenderResponseContext getPortletRenderResponseContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, 
+         PortletWindow window, PortletRequestContext requestContext);
 
-    PortletHeaderResponseContext getPortletHeaderResponseContext(PortletContainer container,
-                                                                 HttpServletRequest containerRequest,
-                                                                 HttpServletResponse containerResponse, PortletWindow window);
+   PortletHeaderResponseContext getPortletHeaderResponseContext(PortletContainer container,
+         HttpServletRequest containerRequest, HttpServletResponse containerResponse, 
+         PortletWindow window, PortletRequestContext requestContext);
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
index b6b4de6..f6f13bc 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
@@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory;
  */
 public abstract class BaseURLImpl implements BaseURL {
    private static final Logger    LOGGER  = LoggerFactory.getLogger(BaseURLImpl.class);
-   private static final boolean   isDebug = LOGGER.isDebugEnabled();
+   private static final boolean   isTrace = LOGGER.isTraceEnabled();
 
    protected PortletResponseContext responseContext;
    protected PortalContext          portalContext;
@@ -73,7 +73,7 @@ public abstract class BaseURLImpl implements BaseURL {
       this.windowId = responseContext.getPortletWindow().getId().getStringId();
       this.urlProvider = urlProvider;
       renderURL = PortletURLProvider.TYPE.RENDER == urlProvider.getType();
-      if (isDebug) {
+      if (isTrace) {
          StringBuilder txt = new StringBuilder();
          txt.append("URL provider type=").append(urlProvider.getType());
          txt.append(", WindowId=").append(windowId);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
----------------------------------------------------------------------
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 b2deeb9..3888ae4 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
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.security.Principal;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -29,7 +28,6 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 
-import javax.portlet.ActionRequest;
 import javax.portlet.ClientDataRequest;
 import javax.portlet.HeaderRequest;
 import javax.portlet.PortletRequest;
@@ -110,8 +108,6 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
 
    private final ArrayList<DispatchElement> dispatches            = new ArrayList<DispatchElement>();
 
-   private final Map<String, List<String>>  params                = new HashMap<String, List<String>>();
-
    private final PortletRequest             preq;
    private boolean                          isMethSpecialHandling = false;
    private boolean                          isAttrSpecialHandling = false;
@@ -254,7 +250,7 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
    }
 
    private void logSetupValues() {
-      if (isDebug) {
+      if (isTrace) {
          StringBuilder txt = new StringBuilder(128);
          txt.append("Wrapper initialized.");
          txt.append(" dispatches.size(): ").append(dispatches.size());
@@ -287,7 +283,7 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
 
    private boolean isLogged = false;
    private void logPathValues() {
-      if (isDebug && !isLogged) {
+      if (isTrace && !isLogged) {
          isLogged = true;
          StringBuilder txt = new StringBuilder(128);
          txt.append("Path values:");
@@ -337,53 +333,6 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       }
    }
 
-   // Rebuild the current servlet parameter map. First come the query parameters,
-   // then the action or resource parameters, and finally the render parameters
-   private void rebuildParameterMap() {
-      if (dispatches.size() > 0) {
-         Map<String, List<String>> qp = dispatches.get(dispatches.size() - 1).qparms;
-
-         params.clear();
-         for (String name : qp.keySet()) {
-            params.put(name, new ArrayList<String>(qp.get(name)));
-         }
-
-         if (preq instanceof ActionRequest) {
-            ActionRequest areq = (ActionRequest) preq;
-            for (String name : areq.getActionParameters().getNames()) {
-               List<String> vals = params.get(name);
-               if (vals == null) {
-                  vals = new ArrayList<String>();
-                  params.put(name, vals);
-               }
-               vals.addAll(Arrays.asList(areq.getActionParameters().getValues(name)));
-            }
-         }
-
-         if (preq instanceof ResourceRequest) {
-            ResourceRequest rreq = (ResourceRequest) preq;
-            for (String name : rreq.getResourceParameters().getNames()) {
-               List<String> vals = params.get(name);
-               if (vals == null) {
-                  vals = new ArrayList<String>();
-                  params.put(name, vals);
-               }
-               vals.addAll(Arrays.asList(rreq.getResourceParameters().getValues(name)));
-            }
-         }
-
-         for (String name : preq.getRenderParameters().getNames()) {
-            List<String> vals = params.get(name);
-            if (vals == null) {
-               vals = new ArrayList<String>();
-               params.put(name, vals);
-            }
-            vals.addAll(Arrays.asList(preq.getRenderParameters().getValues(name)));
-         }
-
-      }
-   }
-
    /* ================ Used by dispatcher code in same package ======================= */
 
    void startInclude(String path) {
@@ -392,7 +341,6 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       de.type = Type.INC;
       de.qparms = processPath(path);
       dispatches.add(de);
-      rebuildParameterMap();
 
       // always need attribute special handling. Need method special handing only if
       // there was no preceding forward, async, or named dispatch
@@ -416,7 +364,6 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       de.type = Type.FWD;
       de.qparms = processPath(path);
       dispatches.add(de);
-      rebuildParameterMap();
       isMethSpecialHandling = !isForwardingPossible();
       isAttrSpecialHandling = true;
       
@@ -431,7 +378,6 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       de.type = Type.ASYNC;
       de.qparms = processPath(path);
       dispatches.add(de);
-      rebuildParameterMap();
       isMethSpecialHandling = false;
       isAttrSpecialHandling = false;
       logSetupValues();
@@ -443,7 +389,6 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       de.type = Type.NAMED;
       de.qparms = processPath(path);
       dispatches.add(de);
-      rebuildParameterMap();
       isMethSpecialHandling = false;
       isAttrSpecialHandling = false;
       logSetupValues();
@@ -453,7 +398,6 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       if (dispatches.size() > 0) {
          dispatches.remove(dispatches.size() - 1);
       }
-      rebuildParameterMap();
       
       // make sure request context is set up properly during nested dispatches
       
@@ -477,28 +421,27 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
 
    @Override
    public Map<String, String[]> getParameterMap() {
-      Map<String, String[]> pm = new HashMap<String, String[]>();
-      for (String name : params.keySet()) {
-         pm.put(name, params.get(name).toArray(new String[0]));
-      }
+      Map<String, String[]> pm = reqctx.getParameterMap();
       return pm;
    }
 
    @Override
    public String getParameter(String name) {
-      List<String> vals = (List<String>) params.get(name);
-      return ((vals == null) || (vals.isEmpty())) ? null : vals.get(0);
+      Map<String, String[]> pm = reqctx.getParameterMap();
+      String[] vals = pm.get(name);
+      return (vals == null) ? null : vals[0];
    }
 
    @Override
    public Enumeration<String> getParameterNames() {
-      return Collections.enumeration(params.keySet());
+      Map<String, String[]> pm = reqctx.getParameterMap();
+      return Collections.enumeration(pm.keySet());
    }
 
    @Override
    public String[] getParameterValues(String name) {
-      List<String> vals = (List<String>) params.get(name);
-      return ((vals == null) ? null : vals.toArray(new String[0]));
+      Map<String, String[]> pm = reqctx.getParameterMap();
+      return pm.get(name);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
index ce60f2e..16eb580 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
@@ -151,7 +151,7 @@ public class PortletContainerImpl implements PortletContainer
         PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
 
         PortletRequestContext requestContext = rcService.getPortletHeaderRequestContext(this, request, response, portletWindow);
-        PortletHeaderResponseContext responseContext = rcService.getPortletHeaderResponseContext(this, request, response, portletWindow);
+        PortletHeaderResponseContext responseContext = rcService.getPortletHeaderResponseContext(this, request, response, portletWindow, requestContext);
         responseContext.setPropsAllowed(true);
         HeaderRequest portletRequest = envService.createHeaderRequest(requestContext, responseContext);
         HeaderResponse portletResponse = envService.createHeaderResponse(responseContext);
@@ -204,7 +204,7 @@ public class PortletContainerImpl implements PortletContainer
         PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
 
         PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
-        PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
+        PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow, requestContext);
 
         if (renderHeaders != null && renderHeaders.equals(PortletRequest.RENDER_HEADERS)) {
            responseContext.setPropsAllowed(true);
@@ -261,7 +261,7 @@ public class PortletContainerImpl implements PortletContainer
         PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
 
         PortletResourceRequestContext requestContext = rcService.getPortletResourceRequestContext(this, request, response, portletWindow, pageState);
-        PortletResourceResponseContext responseContext = rcService.getPortletResourceResponseContext(this, request, response, portletWindow);
+        PortletResourceResponseContext responseContext = rcService.getPortletResourceResponseContext(this, request, response, portletWindow, requestContext);
         responseContext.setPropsAllowed(true);
         ResourceRequest portletRequest = envService.createResourceRequest(requestContext, responseContext);
         ResourceResponse portletResponse = envService.createResourceResponse(responseContext, requestContext.getCacheability());
@@ -317,7 +317,7 @@ public class PortletContainerImpl implements PortletContainer
         PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
 
         PortletRequestContext requestContext = rcService.getPortletActionRequestContext(this, request, response, portletWindow);
-        PortletActionResponseContext responseContext = rcService.getPortletActionResponseContext(this, request, response, portletWindow);
+        PortletActionResponseContext responseContext = rcService.getPortletActionResponseContext(this, request, response, portletWindow, requestContext);
         responseContext.setPropsAllowed(true);
         ActionRequest portletRequest = envService.createActionRequest(requestContext, responseContext);
         ActionResponse portletResponse = envService.createActionResponse(responseContext);
@@ -396,7 +396,7 @@ public class PortletContainerImpl implements PortletContainer
         PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
 
         PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
-        PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
+        PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow, requestContext);
         RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
         RenderResponse portletResponse = envService.createRenderResponse(responseContext);
 
@@ -430,7 +430,7 @@ public class PortletContainerImpl implements PortletContainer
         PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
 
         PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
-        PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
+        PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow, requestContext);
         RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
         RenderResponse portletResponse = envService.createRenderResponse(responseContext);
 
@@ -491,7 +491,7 @@ public class PortletContainerImpl implements PortletContainer
         PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
 
         PortletRequestContext requestContext = rcService.getPortletEventRequestContext(this, request, response, portletWindow);
-        PortletEventResponseContext responseContext = rcService.getPortletEventResponseContext(this, request, response, portletWindow);
+        PortletEventResponseContext responseContext = rcService.getPortletEventResponseContext(this, request, response, portletWindow, requestContext);
         EventRequest portletRequest = envService.createEventRequest(requestContext, responseContext, event);
         EventResponse portletResponse = envService.createEventResponse(responseContext);
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
index e1f8995..8e9322b 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
@@ -48,7 +48,7 @@ import org.slf4j.LoggerFactory;
 public class PortletRequestDispatcherImpl implements PortletRequestDispatcher, RequestDispatcher {
    /** Logger. */
    private static final Logger  LOG     = LoggerFactory.getLogger(PortletRequestDispatcherImpl.class);
-   private final static boolean isDebug = LOG.isDebugEnabled();
+   private final static boolean isTrace = LOG.isTraceEnabled();
 
    // Private Member Variables ------------------------------------------------
 
@@ -76,7 +76,7 @@ public class PortletRequestDispatcherImpl implements PortletRequestDispatcher, R
       this.namedDispatch = namedDispatch;
       this.path = path;
 
-      if (LOG.isDebugEnabled()) {
+      if (isTrace) {
          LOG.debug("Request dispatcher created.");
       }
    }
@@ -208,21 +208,21 @@ public class PortletRequestDispatcherImpl implements PortletRequestDispatcher, R
    // PortletRequestDispatcher Impl -------------------------------------------
 
    public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException {
-      if (isDebug) {
+      if (isTrace) {
          LOG.debug("Doing request dispatcher forward for portlet request.");
       }
       doDispatch(request, response, false);
    }
 
    public void include(PortletRequest request, PortletResponse response) throws PortletException, IOException {
-      if (isDebug) {
+      if (isTrace) {
          LOG.debug("Doing request dispatcher include for portlet request.");
       }
       doDispatch(request, response, true);
    }
 
    public void include(RenderRequest request, RenderResponse response) throws PortletException, IOException {
-      if (isDebug) {
+      if (isTrace) {
          LOG.debug("Doing request dispatcher include for render request.");
       }
       doDispatch(request, response, true);
@@ -234,7 +234,7 @@ public class PortletRequestDispatcherImpl implements PortletRequestDispatcher, R
       HttpServletPortletRequestWrapper req = getWrappedRequest(request);
       HttpServletPortletResponseWrapper res = getWrappedResponse(response);
 
-      if (isDebug) {
+      if (isTrace) {
          StringBuilder txt = new StringBuilder();
          txt.append("Forwarding ... ");
          txt.append(" hreq: ").append((req == null) ? "null" : "not null");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
index 51773f5..f3befd7 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletActionResponseContext;
 import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.driver.core.PortalRequestContext;
 import org.apache.pluto.driver.url.PortalURL;
@@ -41,9 +42,9 @@ public class PortletActionResponseContextImpl extends PortletStateAwareResponseC
     private String renderURLParamName;
     
     public PortletActionResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                            HttpServletResponse containerResponse, PortletWindow window)
+          HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext)
     {
-        super(container, containerRequest, containerResponse, window);
+        super(container, containerRequest, containerResponse, window, requestContext);
         setLifecycle(PortletRequest.ACTION_PHASE);
     }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
index d717aa8..ef1ddbe 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletEventResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletWindow;
 
 /**
@@ -33,9 +34,9 @@ public class PortletEventResponseContextImpl extends PortletStateAwareResponseCo
 {
 
     public PortletEventResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                           HttpServletResponse containerResponse, PortletWindow window)
+          HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext)
     {
-        super(container, containerRequest, containerResponse, window);
+        super(container, containerRequest, containerResponse, window, requestContext);
         setLifecycle(PortletRequest.EVENT_PHASE);
     }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
index e74b824..448ef54 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletHeaderResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.driver.AttributeKeys;
 
@@ -36,9 +37,9 @@ public class PortletHeaderResponseContextImpl extends PortletMimeResponseContext
                 PortletHeaderResponseContext
 {
     public PortletHeaderResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                            HttpServletResponse containerResponse, PortletWindow window)
+          HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext)
     {
-        super(container, containerRequest, containerResponse, window);
+        super(container, containerRequest, containerResponse, window, requestContext);
         setLifecycle(PortletRequest.HEADER_PHASE);
     }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
index ffbdc2d..275e8a6 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletMimeResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.util.PrintWriterServletOutputStream;
 
@@ -82,8 +83,8 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
    private OutputStream outputStream;
 
    public PortletMimeResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-         HttpServletResponse containerResponse, PortletWindow window) {
-      super(container, containerRequest, containerResponse, window);
+         HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext) {
+      super(container, containerRequest, containerResponse, window, requestContext);
    }
 
    public void close() {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
index 02bfd20..583e831 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletRenderResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.driver.AttributeKeys;
 
@@ -36,9 +37,9 @@ public class PortletRenderResponseContextImpl extends PortletMimeResponseContext
                 PortletRenderResponseContext
 {
     public PortletRenderResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                            HttpServletResponse containerResponse, PortletWindow window)
+          HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext)
     {
-        super(container, containerRequest, containerResponse, window);
+        super(container, containerRequest, containerResponse, window, requestContext);
         setLifecycle(PortletRequest.RENDER_PHASE);
     }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
index 0815598..64c3b3c 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
@@ -72,6 +72,9 @@ public class PortletRequestContextImpl implements PortletRequestContext {
    private Cookie              cookies[];
    private String              renderHeaders = null; 
    private boolean             executingRequestBody = false;
+   private Map<String, List<String>> queryParams = null;
+   private String              phase = null;
+
    
    // make sure these classes are loaded first by the container classloader
    // so that the logs from these classes land in the Pluto log file.
@@ -101,8 +104,8 @@ public class PortletRequestContextImpl implements PortletRequestContext {
       this.window = window;
       this.windowId = window.getId().getStringId();
       this.url = PortalRequestContext.getContext(containerRequest).createPortalURL();
-      this.urlProvider = new PortletURLProviderImpl(url, window);
-      this.paramFactory = url.getPortletParameterFactory();
+      this.urlProvider = new PortletURLProviderImpl(url, window, this);
+      this.paramFactory = url.getPortletParameterFactory(this);
    }
 
    @Override
@@ -155,7 +158,15 @@ public class PortletRequestContextImpl implements PortletRequestContext {
    public void startDispatch(HttpServletRequest wrappedServletRequest, 
          Map<String, List<String>> queryParams, String phase) {
       this.wrappedServletRequest = wrappedServletRequest;
-      paramFactory.startDispatch(queryParams, phase);
+      this.queryParams = queryParams;
+      this.phase = phase;
+      if (LOG.isTraceEnabled()) {
+         StringBuilder txt = new StringBuilder();
+         txt.append("Added query parameters.");
+         txt.append(" Phase: ").append(phase);
+         txt.append(", names: ").append(queryParams.keySet());
+         LOG.debug(txt.toString());
+      }
    }
    
    /**
@@ -164,7 +175,27 @@ public class PortletRequestContextImpl implements PortletRequestContext {
    @Override
    public void endDispatch() {
       this.wrappedServletRequest = null;
-      paramFactory.endDispatch();
+      this.phase = null;
+      this.queryParams = null;
+      if (LOG.isTraceEnabled()) {
+         LOG.debug("deleted query parameters.");
+      }
+   }
+   
+   /*
+    * Gets the query string parameters set for request dispatch processing
+    */
+   @Override
+   public Map<String, List<String>> getQueryParams(){
+      return queryParams;
+   }
+   
+   /*
+    * Gets the processing phase set for request dispatch processing
+    */
+   @Override
+   public String getPhase() {
+      return phase;
    }
    
    /*

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
index c744243..86f7998 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
@@ -45,9 +45,9 @@ public class PortletRequestContextServiceImpl implements PortletRequestContextSe
     public PortletActionResponseContext getPortletActionResponseContext(PortletContainer container,
                                                                         HttpServletRequest containerRequest,
                                                                         HttpServletResponse containerResponse,
-                                                                        PortletWindow window)
+                                                                        PortletWindow window, PortletRequestContext requestContext)
     {
-        return new PortletActionResponseContextImpl(container, containerRequest, containerResponse, window);
+        return new PortletActionResponseContextImpl(container, containerRequest, containerResponse, window, requestContext);
     }
 
     public PortletRequestContext getPortletEventRequestContext(PortletContainer container, HttpServletRequest containerRequest,
@@ -58,9 +58,9 @@ public class PortletRequestContextServiceImpl implements PortletRequestContextSe
 
     public PortletEventResponseContext getPortletEventResponseContext(PortletContainer container,
                                                                       HttpServletRequest containerRequest,
-                                                                      HttpServletResponse containerResponse, PortletWindow window)
+                                                                      HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext)
     {
-        return new PortletEventResponseContextImpl(container, containerRequest, containerResponse, window);
+        return new PortletEventResponseContextImpl(container, containerRequest, containerResponse, window, requestContext);
     }
 
     public PortletRequestContext getPortletRenderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
@@ -72,9 +72,9 @@ public class PortletRequestContextServiceImpl implements PortletRequestContextSe
     public PortletRenderResponseContext getPortletRenderResponseContext(PortletContainer container,
                                                                         HttpServletRequest containerRequest,
                                                                         HttpServletResponse containerResponse,
-                                                                        PortletWindow window)
+                                                                        PortletWindow window, PortletRequestContext requestContext)
     {
-        return new PortletRenderResponseContextImpl(container, containerRequest, containerResponse, window);
+        return new PortletRenderResponseContextImpl(container, containerRequest, containerResponse, window, requestContext);
     }
 
     public PortletRequestContext getPortletHeaderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
@@ -86,9 +86,9 @@ public class PortletRequestContextServiceImpl implements PortletRequestContextSe
     public PortletHeaderResponseContext getPortletHeaderResponseContext(PortletContainer container,
                                                                         HttpServletRequest containerRequest,
                                                                         HttpServletResponse containerResponse,
-                                                                        PortletWindow window)
+                                                                        PortletWindow window, PortletRequestContext requestContext)
     {
-        return new PortletHeaderResponseContextImpl(container, containerRequest, containerResponse, window);
+        return new PortletHeaderResponseContextImpl(container, containerRequest, containerResponse, window, requestContext);
     }
 
     public PortletResourceRequestContext getPortletResourceRequestContext(PortletContainer container,
@@ -103,8 +103,8 @@ public class PortletRequestContextServiceImpl implements PortletRequestContextSe
     public PortletResourceResponseContext getPortletResourceResponseContext(PortletContainer container,
                                                                             HttpServletRequest containerRequest,
                                                                             HttpServletResponse containerResponse,
-                                                                            PortletWindow window)
+                                                                            PortletWindow window, PortletRequestContext requestContext)
     {
-        return new PortletResourceResponseContextImpl(container, containerRequest, containerResponse, window);
+        return new PortletResourceResponseContextImpl(container, containerRequest, containerResponse, window, requestContext);
     }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
index 366dace..4302004 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletResourceResponseContext;
 import org.apache.pluto.container.PortletWindow;
 import org.slf4j.Logger;
@@ -39,9 +40,9 @@ public class PortletResourceResponseContextImpl extends PortletMimeResponseConte
    private static final boolean   isTrace = LOGGER.isTraceEnabled();
     
     public PortletResourceResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                              HttpServletResponse containerResponse, PortletWindow window)
+          HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext)
     {        
-        super(container, containerRequest, containerResponse, window);
+        super(container, containerRequest, containerResponse, window, requestContext);
         setLifecycle(PortletRequest.RESOURCE_PHASE);
     }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
index 0d698f6..4e9a75f 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
@@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.HeaderData;
 import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletURLProvider;
 import org.apache.pluto.container.PortletURLProvider.TYPE;
@@ -81,14 +82,24 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
    
    // holder for the header data
    protected HeaderData             headerData        = new HeaderData();
+   
+   private final PortletRequestContext requestContext;
 
    public PortletResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-         HttpServletResponse containerResponse, PortletWindow window) {
+         HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext) {
       this.container = container;
       this.containerRequest = containerRequest;
       this.containerResponse = containerResponse;
       this.window = window;
       this.portalURL = PortalRequestContext.getContext(containerRequest).createPortalURL();
+      this.requestContext = requestContext;
+   }
+
+   /**
+    * @return the requestContext
+    */
+   public PortletRequestContext getRequestContext() {
+      return requestContext;
    }
 
    public String getLifecycle() {
@@ -295,6 +306,7 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
    }
 
    public PortletURLProvider getPortletURLProvider(TYPE type) {
-      return isClosed() ? null : new PortletURLProviderImpl(getPortalURL(), type, getPortletWindow());
+      return isClosed() ? null : 
+         new PortletURLProviderImpl(getPortalURL(), type, getPortletWindow(), getRequestContext());
    }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletStateAwareResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletStateAwareResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletStateAwareResponseContextImpl.java
index d8600bf..402cf67 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletStateAwareResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletStateAwareResponseContextImpl.java
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.EventProvider;
 import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletStateAwareResponseContext;
 import org.apache.pluto.container.PortletURLProvider;
 import org.apache.pluto.container.PortletWindow;
@@ -54,10 +55,11 @@ public abstract class PortletStateAwareResponseContextImpl extends PortletRespon
     private PortletURLProviderImpl portletURLProvider;
     
     public PortletStateAwareResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                                HttpServletResponse containerResponse, PortletWindow window)
+                                                HttpServletResponse containerResponse, PortletWindow window, PortletRequestContext requestContext)
     {
-        super(container, containerRequest, containerResponse, window);
-        this.portletURLProvider = new PortletURLProviderImpl(getPortalURL(), PortletURLProvider.TYPE.RENDER, window);
+        super(container, containerRequest, containerResponse, window, requestContext);
+        this.portletURLProvider = new PortletURLProviderImpl(getPortalURL(), 
+              PortletURLProvider.TYPE.RENDER, window, getRequestContext());
         
         if (isDebug) {
            LOGGER.debug("Initialized.");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.java
index a56004e..0369300 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.java
@@ -32,6 +32,7 @@ import javax.portlet.PortletSecurityException;
 import javax.portlet.ResourceURL;
 import javax.portlet.WindowState;
 
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletURLProvider;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.driver.services.portal.PublicRenderParameterMapper;
@@ -91,11 +92,11 @@ public class PortletURLProviderImpl implements PortletURLProvider {
     * @param portletWindow
     */
    public PortletURLProviderImpl(PortalURL url, TYPE type,
-         PortletWindow portletWindow) {
+         PortletWindow portletWindow, PortletRequestContext reqctx) {
       this.url = url.clone();
       this.type = type;
       this.window = portletWindow.getId().getStringId();
-      this.paramFactory = this.url.getPortletParameterFactory();
+      this.paramFactory = this.url.getPortletParameterFactory(reqctx);
 
       if (isTrace) {
          StringBuilder txt = new StringBuilder("Constructing PortalURLProviderImpl. ");
@@ -161,11 +162,11 @@ public class PortletURLProviderImpl implements PortletURLProvider {
     * @param url
     * @param windowId
     */
-   public PortletURLProviderImpl(PortalURL url, PortletWindow portletWindow) {
+   public PortletURLProviderImpl(PortalURL url, PortletWindow portletWindow, PortletRequestContext reqctx) {
       this.url = url;
       this.type = urlTypeMap.get(url.getType());
       this.window = portletWindow.getId().getStringId();
-      this.paramFactory = this.url.getPortletParameterFactory();
+      this.paramFactory = this.url.getPortletParameterFactory(reqctx);
 
       if (isTrace) {
          StringBuilder txt = new StringBuilder("Created 'read-only' URL provider.");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java
index a116b34..922c459 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java
@@ -30,6 +30,7 @@ import javax.portlet.WindowState;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.driver.AttributeKeys;
 import org.apache.pluto.driver.config.DriverConfiguration;
 import org.apache.pluto.driver.services.portal.PageConfig;
@@ -561,9 +562,9 @@ public class RelativePortalURLImpl implements PortalURL {
       parameters.add(param);
    }
 
-   public PortletParameterFactory getPortletParameterFactory() {
+   public PortletParameterFactory getPortletParameterFactory(PortletRequestContext reqctx) {
       handleServletRequestParams();
-      return new PortletParameterFactory(this);
+      return new PortletParameterFactory(this, reqctx);
    }
 
    public void setPublicRenderParameterMapper(PublicRenderParameterMapper prpm) {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
index d9bc653..3b77116 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
@@ -23,6 +23,7 @@ import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
 import javax.servlet.ServletContext;
 
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.driver.services.portal.PageConfig;
 import org.apache.pluto.driver.services.portal.PublicRenderParameterMapper;
 
@@ -44,7 +45,7 @@ public interface PortalURL extends Cloneable {
       Portal;
    }
    
-   public PortletParameterFactory getPortletParameterFactory();
+   public PortletParameterFactory getPortletParameterFactory(PortletRequestContext reqctx);
    
    /**
     * Sets the URL type

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e72ed5fa/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
index a7e5dbe..95f13d1 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
@@ -26,10 +26,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.driver.services.portal.PublicRenderParameterMapper;
 import org.apache.pluto.driver.url.PortalURL.URLType;
+
 import static org.apache.pluto.driver.url.PortalURLParameter.*;
 import static javax.portlet.PortletRequest.*;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -44,13 +47,11 @@ import org.slf4j.LoggerFactory;
  */
 public class PortletParameterFactory {
    private static final Logger LOGGER = LoggerFactory.getLogger(PortletParameterFactory.class);
-   //private final static boolean isTrace = LOGGER.isTraceEnabled();
-   private final static boolean isTrace = LOGGER.isDebugEnabled();
+   private final static boolean isTrace = LOGGER.isTraceEnabled();
+   @SuppressWarnings("unused")
    private final static boolean isDebug = LOGGER.isDebugEnabled();
    
-   PortalURL url;
-   Map<String, List<String>> queryParams = null;
-   String phase = null;
+   private PortalURL url;
    
    static final HashSet<PortalURL.URLType> actionTypes = new HashSet<PortalURL.URLType>();
    static {
@@ -67,31 +68,11 @@ public class PortletParameterFactory {
       urlTypeMap.put(URLType.Resource, PortalURLParameter.PARAM_TYPE_RESOURCE);
    }
    
-   public PortletParameterFactory(PortalURL url) {
-      this.url = url;
-   }
-   
-   // Used for setting extra parameters from the query string during a 
-   // request dispatcher forward or include
-   
-   public void startDispatch(Map<String, List<String>> queryParams, String phase) {
-      this.queryParams = queryParams;
-      this.phase = phase;
-      if (isDebug) {
-         StringBuilder txt = new StringBuilder();
-         txt.append("Added query parameters.");
-         txt.append(" Phase: ").append(phase);
-         txt.append(", names: ").append(queryParams.keySet());
-         LOGGER.debug(txt.toString());
-      }
-   }
+   private final PortletRequestContext reqctx;
    
-   public void endDispatch() {
-      this.queryParams = null;
-      this.phase = null;
-      if (isDebug) {
-         LOGGER.debug("deleted query parameters.");
-      }
+   public PortletParameterFactory(PortalURL url, PortletRequestContext reqctx) {
+      this.url = url;
+      this.reqctx = reqctx;
    }
 
    /**
@@ -116,6 +97,7 @@ public class PortletParameterFactory {
       
       // add the query parameters, if any
       
+      Map<String, List<String>> queryParams = reqctx.getQueryParams();
       if (queryParams != null) {
          for (String name : queryParams.keySet()) {
             parameters.put(name, queryParams.get(name).toArray(new String[0]));
@@ -209,6 +191,7 @@ public class PortletParameterFactory {
       
       // add the query parameters, if any
       
+      Map<String, List<String>> queryParams = reqctx.getQueryParams();
       if (queryParams != null) {
          for (String name : queryParams.keySet()) {
             parameters.put(name, queryParams.get(name).toArray(new String[0]));
@@ -371,6 +354,7 @@ public class PortletParameterFactory {
       
       // Get the query parameter names, if any
       
+      Map<String, List<String>> queryParams = reqctx.getQueryParams();
       if (queryParams != null) {
          names.addAll(queryParams.keySet());
       }
@@ -428,6 +412,7 @@ public class PortletParameterFactory {
       
       // handle query string values
       
+      Map<String, List<String>> queryParams = reqctx.getQueryParams();
       if (queryParams != null) {
          if (queryParams.containsKey(name)) {
             List<String> qpvals = new ArrayList<String>(queryParams.get(name));
@@ -505,6 +490,8 @@ public class PortletParameterFactory {
       
       // add the query parameters, if any
       
+      Map<String, List<String>> queryParams = reqctx.getQueryParams();
+      String phase = reqctx.getPhase();
       if (queryParams != null) {
          HashMap<String, String[]> qp = new HashMap<String, String[]>();
          for (String name : queryParams.keySet()) {


Mime
View raw message