tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core WrappedRequest.java
Date Wed, 27 Sep 2000 18:44:25 GMT
craigmcc    00/09/27 11:44:25

  Modified:    catalina/src/share/org/apache/catalina/core
                        WrappedRequest.java
  Log:
  Finish implementing the new 2.3 methods on WrappedRequest.
  
  Revision  Changes    Path
  1.7       +27 -7     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/WrappedRequest.java
  
  Index: WrappedRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/WrappedRequest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WrappedRequest.java	2000/09/27 02:13:01	1.6
  +++ WrappedRequest.java	2000/09/27 18:44:24	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/WrappedRequest.java,v
1.6 2000/09/27 02:13:01 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/09/27 02:13:01 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/WrappedRequest.java,v
1.7 2000/09/27 18:44:24 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/09/27 18:44:24 $
    *
    * ====================================================================
    *
  @@ -90,6 +90,7 @@
   import org.apache.catalina.Response;
   import org.apache.catalina.Wrapper;
   import org.apache.catalina.util.Enumerator;
  +import org.apache.catalina.util.ParameterMap;
   import org.apache.catalina.util.StringManager;
   
   
  @@ -113,7 +114,7 @@
    * <code>parameters</code> instance variables.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/09/27 02:13:01 $
  + * @version $Revision: 1.7 $ $Date: 2000/09/27 18:44:24 $
    */
   
   final class WrappedRequest
  @@ -152,6 +153,7 @@
   	this.queryString = queryString;
   
   	// Initialize our parameters from the wrapped request.
  +	parameters.setLocked(false);
   	names = srequest.getParameterNames();
   	while (names.hasMoreElements()) {
   	    String name = (String) names.nextElement();
  @@ -187,6 +189,7 @@
   	        mergedValues[i] = oldValues[i - newValues.length];
   	    parameters.put(name, mergedValues);
   	}
  +	parameters.setLocked(true);
   
   
       }
  @@ -219,7 +222,7 @@
        * The parameters for this wrapped request (initialized from the underlying
        * request, but possibly amended).
        */
  -    private HashMap parameters = new HashMap();
  +    private ParameterMap parameters = new ParameterMap();
   
   
       /**
  @@ -328,7 +331,9 @@
        * Clear the collection of parameters associated with this Request.
        */
       public void clearParameters() {
  +        parameters.setLocked(false);
           request.clearParameters();
  +	parameters.setLocked(true);
       }
   
   
  @@ -610,7 +615,22 @@
        * Return the reconstructed URL for this request.
        */
       public StringBuffer getRequestURL() {
  -        return (null); // FIXME - getRequestURL()
  +        StringBuffer url = new StringBuffer();
  +	String scheme = getScheme();
  +	int port = getServerPort();
  +	if (port < 0)
  +	    port = 80; // Work around java.net.URL bug
  +
  +	url.append(scheme);
  +	url.append("://");
  +	url.append(getServerName());
  +	if ((scheme.equals("http") && (port != 80))
  +	    || (scheme.equals("https") && (port != 443))) {
  +	    url.append(':');
  +	    url.append(port);
  +	}
  +	url.append(getRequestURI());
  +	return (url);
       }
   
   
  @@ -1087,7 +1107,7 @@
        * Return a Map of the parameters for this request.
        */
       public Map getParameterMap() {
  -        return (null); // FIXME - getParameterMap()
  +        return (this.parameters);
       }
   
   
  
  
  

Mime
View raw message