[seam-commits] Seam SVN: r10263 - trunk/src/main/org/jboss/seam/faces.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Apr 1 03:19:23 EDT 2009


Author: dan.j.allen
Date: 2009-04-01 03:19:23 -0400 (Wed, 01 Apr 2009)
New Revision: 10263

Modified:
   trunk/src/main/org/jboss/seam/faces/Redirect.java
Log:
JBSEAM-4066


Modified: trunk/src/main/org/jboss/seam/faces/Redirect.java
===================================================================
--- trunk/src/main/org/jboss/seam/faces/Redirect.java	2009-04-01 07:03:21 UTC (rev 10262)
+++ trunk/src/main/org/jboss/seam/faces/Redirect.java	2009-04-01 07:19:23 UTC (rev 10263)
@@ -94,10 +94,11 @@
    }
    
    /**
-    * Capture the view id and page parameters from the
-    * current request and squirrel them away so we can
-    * return here later in the conversation. If no
-    * conversation is active, begin a conversation.
+    * Capture the view id, request parameters and page parameters (which take
+    * precedence) from the current request and squirrel them away so we can
+    * return here later in the conversation. If no conversation is active,
+    * begin a conversation. The conversation is terminated by {@link
+    * Redirect#returnToCapturedView()} if begun by this method.
     * 
     * @see Redirect#returnToCapturedView()
     */
@@ -108,12 +109,16 @@
       // If this isn't a faces request then just return
       if (context == null) return;
       
-      parameters = Pages.instance().getStringValuesFromPageContext(context);
+      // first capture all request parameters
+      parameters.putAll( context.getExternalContext().getRequestParameterMap() );
+      // then preserve page parameters, overwriting request parameters with same names
+      parameters.putAll( Pages.instance().getStringValuesFromPageContext(context) );
       
-      if (context.getExternalContext().getRequestParameterMap().containsKey("actionMethod"))
-      {
-         parameters.put("actionMethod", context.getExternalContext().getRequestParameterMap().get("actionMethod"));
-      }
+      // special case only needed for actionMethod if decide not to capture all request parameters
+      //if (context.getExternalContext().getRequestParameterMap().containsKey("actionMethod"))
+      //{
+      //   parameters.put("actionMethod", context.getExternalContext().getRequestParameterMap().get("actionMethod"));
+      //}
       
       viewId = Pages.getViewId(context);
       conversationBegun = Conversation.instance().begin(true, false);




More information about the seam-commits mailing list