[jboss-cvs] jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168 ...

Julien Viet julien at jboss.com
Sun Jul 30 18:35:17 EDT 2006


  User: julien  
  Date: 06/07/30 18:35:17

  Modified:    portlet/src/main/org/jboss/portal/portlet/impl/jsr168 
                        ActionRequestImpl.java
  Log:
  move the code to append a parameter map to the Parameters class as it will be reused from there
  
  Revision  Changes    Path
  1.11      +12 -28    jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionRequestImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ActionRequestImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionRequestImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- ActionRequestImpl.java	7 May 2006 21:00:20 -0000	1.10
  +++ ActionRequestImpl.java	30 Jul 2006 22:35:17 -0000	1.11
  @@ -25,10 +25,6 @@
   import java.io.IOException;
   import java.io.InputStream;
   import java.io.UnsupportedEncodingException;
  -import java.util.Enumeration;
  -import java.util.Map;
  -import java.util.Iterator;
  -import java.util.Collections;
   
   import javax.portlet.ActionRequest;
   
  @@ -37,11 +33,10 @@
   import org.jboss.portal.portlet.ParametersStateString;
   import org.jboss.portal.portlet.StateString;
   import org.jboss.portal.server.util.Parameters;
  -import org.jboss.portal.common.util.Tools;
   
   /**
    * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public class ActionRequestImpl extends PortletRequestImpl implements ActionRequest
   {
  @@ -54,15 +49,13 @@
         super(invocation);
         this.actionContext = (ActionContext)invocation.getContext();
   
  -      //
  -      parameters = actionContext.getForm();
  -
         // Get the possibly null interaction state
         StateString interactionState = actionContext.getInteractionState();
   
  -      //
  +      // Take care of the interaction state if any
         if (interactionState != null)
         {
  +         // Unserialize the interaction state if necessary
            ParametersStateString parametersState = null;
            if (interactionState instanceof ParametersStateString)
            {
  @@ -74,30 +67,21 @@
            }
   
            //
  +         parameters = parametersState.getParametersValue();
  +      }
  +
  +      //
  +      Parameters form = actionContext.getForm();
  +      if (form != null)
  +      {
            if (parameters == null)
            {
  -            parameters = new Parameters();
  +            parameters = form;
            }
            else
            {
               parameters = new Parameters(parameters);
  -         }
  -
  -         //
  -         for (Iterator i = parametersState.getParametersValue().getMap().entrySet().iterator(); i.hasNext();)
  -         {
  -            Map.Entry entry = (Map.Entry)i.next();
  -            String name = (String)entry.getKey();
  -            String[] values1 = (String[])entry.getValue();
  -            String[] values2 = parameters.getValues(name);
  -            if (values2 != null)
  -            {
  -               String[] tmp = new String[values1.length + values2.length];
  -               System.arraycopy(values1, 0, tmp, 0, values1.length);
  -               System.arraycopy(values2, 0, tmp, values1.length, values2.length);
  -               values1 = tmp;
  -            }
  -            parameters.setValues(name, values1);
  +            parameters.append(form);
            }
         }
      }
  
  
  



More information about the jboss-cvs-commits mailing list