/**
 * Copyright  2004 The JA-SIG Collaborative.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the JA-SIG Collaborative
 *    (http://www.jasig.org/)."
 *
 * THIS SOFTWARE IS PROVIDED BY THE JA-SIG COLLABORATIVE "AS IS" AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE JA-SIG COLLABORATIVE OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

package org.jasig.portal.container.servlet;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;


/**
 * A wrapper of the real HttpServletRequest that allows
 * modification of the request parameters.
 * @author Ken Weiner, kweiner@unicon.net
 * @version $Revision$
 */
public class ServletRequestImpl extends HttpServletRequestWrapper {
    
    protected Hashtable parameters;
    
    public ServletRequestImpl(HttpServletRequest request) {
        super(request);
        parameters = new Hashtable(request.getParameterMap());
    }
    
    public String getParameter(String name) {
        return (String)parameters.get(name);
    }

    public Map getParameterMap() {
        return parameters;
    }

    public Enumeration getParameterNames() {
        return parameters.keys();
    }

    public String[] getParameterValues(String arg0) {
        return (String[])parameters.values().toArray(new String[0]);
    }

    /**
     * Replaces the existing request parameters with a new set
     * of parameters.
     * @param parameters the new parameters
     */
    public void setParameters(Map parameters) {
        this.parameters.clear();
        this.parameters.putAll(parameters);
    }

}
@@ -2319,30 +2319,41 @@
         
-return
+String%5B%5D values =
  (String
 )paramet
@@ -2344,16 +2344,18 @@
  (String
+%5B%5D
 )paramet
@@ -2368,16 +2368,135 @@
 t(name);
+%0A%0A        if (values == null %7C%7C values.length %3C= 0)%0A            return null;%0A        else%0A            return values%5B0%5D;
 %0A    %7D%0A%0A
@@ -2700,12 +2700,12 @@
 ing 
-arg0
+name
 ) %7B%0A
@@ -2744,38 +2744,16 @@
 ers.
-values().toArray(new String%5B0%5D
+get(name
 );%0A 

Fix for bug 1658 This code is currently not used but the parameter handling was incorrect