tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core LocalStrings.properties Request.java RequestDispatcherImpl.java Response.java
Date Sun, 06 Feb 2000 20:40:43 GMT
akv         00/02/06 12:40:43

  Modified:    src/etc  Tag: latest_TOMCAT_30 readme
               src/share/org/apache/jasper/compiler Tag: latest_TOMCAT_30
                        Compiler.java EscapeUnicodeWriter.java
               src/share/org/apache/jasper/runtime Tag: latest_TOMCAT_30
                        JspLoader.java
               src/share/org/apache/tomcat/core Tag: latest_TOMCAT_30
                        LocalStrings.properties Request.java
                        RequestDispatcherImpl.java Response.java
  Log:
  Integrated select patches into the branch...
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.1   +1 -8      jakarta-tomcat/src/etc/readme
  
  Index: readme
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/etc/readme,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- readme	1999/12/15 01:35:28	1.7
  +++ readme	2000/02/06 20:40:41	1.7.2.1
  @@ -1,4 +1,4 @@
  -$Id: readme,v 1.7 1999/12/15 01:35:28 akv Exp $
  +$Id: readme,v 1.7.2.1 2000/02/06 20:40:41 akv Exp $
   	
   Tomcat 3.0
   
  @@ -59,13 +59,6 @@
   2. The web server crashes with a StackOverflowException if there
      is infinite recursion in RequestDispatcher.forward/include or
      <jsp:forward/include .../>.
  -
  -3. The JSP container may generate invalid Java code from JSP pages if
  -   multiple pages are being accessed for the first time at roughly the
  -   same time. This results in a compilation error. A work-around is to 
  -   access the JSP pages one at the time to get correct code generated.
  -   When the code is generated and compiled, there are no known
  -   multi-threading issues.  
   
   TROUBLESHOOTING
   ---------------
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.3   +4 -3      jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -r1.3.2.2 -r1.3.2.3
  --- Compiler.java	2000/02/04 01:37:14	1.3.2.2
  +++ Compiler.java	2000/02/06 20:40:41	1.3.2.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
1.3.2.2 2000/02/04 01:37:14 mandar Exp $
  - * $Revision: 1.3.2.2 $
  - * $Date: 2000/02/04 01:37:14 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
1.3.2.3 2000/02/06 20:40:41 akv Exp $
  + * $Revision: 1.3.2.3 $
  + * $Date: 2000/02/06 20:40:41 $
    *
    * ====================================================================
    * 
  @@ -122,6 +122,7 @@
           Constants.message("jsp.message.class_file_name_is",
                             new Object[] { classFileName },
                             Constants.MED_VERBOSITY);
  +
           if (!isOutDated())
               return false;
           
  
  
  
  1.1.1.1.4.1 +4 -4      jakarta-tomcat/src/share/org/apache/jasper/compiler/EscapeUnicodeWriter.java
  
  Index: EscapeUnicodeWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/EscapeUnicodeWriter.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.4.1
  diff -u -r1.1.1.1 -r1.1.1.1.4.1
  --- EscapeUnicodeWriter.java	1999/10/09 00:20:35	1.1.1.1
  +++ EscapeUnicodeWriter.java	2000/02/06 20:40:41	1.1.1.1.4.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/EscapeUnicodeWriter.java,v
1.1.1.1 1999/10/09 00:20:35 duncan Exp $
  - * $Revision: 1.1.1.1 $
  - * $Date: 1999/10/09 00:20:35 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/EscapeUnicodeWriter.java,v
1.1.1.1.4.1 2000/02/06 20:40:41 akv Exp $
  + * $Revision: 1.1.1.1.4.1 $
  + * $Date: 2000/02/06 20:40:41 $
    *
    * ====================================================================
    * 
  @@ -88,7 +88,7 @@
           
   	int ci = off, end = off + len;
   	while ( --len >= 0 ) {
  -	    int ch = buf[off++] & 0xff;
  +	    int ch = buf[off++] & 0xffff;
   	    /*
   	     * Write out unicode characters as \u0000
   	     */
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +6 -5      jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java
  
  Index: JspLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- JspLoader.java	1999/10/21 01:48:42	1.2
  +++ JspLoader.java	2000/02/06 20:40:42	1.2.4.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v
1.2 1999/10/21 01:48:42 akv Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/21 01:48:42 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v
1.2.4.1 2000/02/06 20:40:42 akv Exp $
  + * $Revision: 1.2.4.1 $
  + * $Date: 2000/02/06 20:40:42 $
    *
    * ====================================================================
    * 
  @@ -207,8 +207,9 @@
        *  @param classpath explicitly set the JSP compilation path.
        *  @return true if JSP files is newer
        */
  -    public boolean loadJSP(String name, String classpath, boolean isErrorPage, 
  -                           HttpServletRequest req, HttpServletResponse res) 
  +    public synchronized boolean loadJSP(String name, String classpath, 
  +					boolean isErrorPage, HttpServletRequest req, 
  +					HttpServletResponse res) 
   	throws JasperException, FileNotFoundException 
       {
   	Class jspClass = (Class) loadedJSPs.get(name);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +4 -1      jakarta-tomcat/src/share/org/apache/tomcat/core/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/LocalStrings.properties,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- LocalStrings.properties	1999/10/31 19:27:59	1.2
  +++ LocalStrings.properties	2000/02/06 20:40:42	1.2.2.1
  @@ -1,4 +1,4 @@
  -# $Id: LocalStrings.properties,v 1.2 1999/10/31 19:27:59 costin Exp $
  +# $Id: LocalStrings.properties,v 1.2.2.1 2000/02/06 20:40:42 akv Exp $
   #
   
   # Localized strings for package org.apache.tomcat.core
  @@ -45,6 +45,9 @@
   rdi.forward.ise=Cannot forward as OutputStream or Writer has already been obtained
   
   serverSession.value.iae=null value
  +
  +serverReponse.outputStream.ise=getWriter() has already been called
  +serverResponse.ise.writer.ise=getOutputStream() has already been called
   
   servletLoader.load.mfue=trouble resolving class name: {0}
   servletLoader.load.ioe=trouble reading class file: {0}
  
  
  
  1.8.2.1   +68 -4     jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- Request.java	1999/11/03 20:38:52	1.8
  +++ Request.java	2000/02/06 20:40:42	1.8.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v 1.8
1999/11/03 20:38:52 costin Exp $
  - * $Revision: 1.8 $
  - * $Date: 1999/11/03 20:38:52 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v 1.8.2.1
2000/02/06 20:40:42 akv Exp $
  + * $Revision: 1.8.2.1 $
  + * $Date: 2000/02/06 20:40:42 $
    *
    * ====================================================================
    *
  @@ -78,6 +78,7 @@
    * @author James Todd [gonzo@eng.sun.com]
    * @author Jason Hunter [jch@eng.sun.com]
    * @author Harish Prabandham
  + * @author Alex Cruikshank [alex@apitonic.com]
    */
   public class Request  {
       // XXX used by forward to override, need a better
  @@ -85,7 +86,7 @@
       protected String requestURI;
       protected String queryString;
    
  -   //  RequestAdapterImpl Hints
  +    //  RequestAdapterImpl Hints
       String serverName;
       protected Vector cookies = new Vector();
   
  @@ -227,6 +228,22 @@
   
           return parameters.keys();
       }
  +
  +    /**
  +     * Used by RequestDispatcherImpl to get a copy of the 
  +     * original parameters before adding parameters from the 
  +     * query string, if any.
  +     */
  +    public Hashtable getParametersCopy() {
  +	if (!didParameters) {
  +	    processFormData(getQueryString());
  +	}
  +	if (!didReadFormData) {
  +	    readFormData();
  +	}
  +	return (Hashtable) parameters.clone();
  +    }
  +    
       
   
       public String getAuthType() {
  @@ -466,7 +483,54 @@
   //     public void setScheme(String scheme) {
   //         this.scheme = scheme;
   //     }
  +
  +
  +    /**
  +     * Adds a query string to the existing set of parameters. 
  +     * The additional parameters represented by the query string will be 
  +     * merged with the existing parameters. 
  +     * Used by the RequestDispatcherImpl to add query string parameters
  +     * to the request. 
  +     *
  +     * @param inQueryString URLEncoded parameters to add
  +     */
  +    public void addQueryString(String inQueryString) {
  +	// if query string is null, do nothing
  +	if ((inQueryString == null) || (inQueryString.trim().length() <= 0))
  +	    return;
  +	
  +	// add query string to existing string
  +	if ((queryString == null) || (queryString.trim().length() <= 0))
  +	    queryString = inQueryString;
  +	else
  +	    queryString = inQueryString + "&" + queryString;
  +	
  +	// process parameters
  +	Hashtable newParameters = null;
  +	try {
  +	    newParameters = HttpUtils.parseQueryString(queryString);
  +	} catch (Exception e) {
  +	    return;
  +	}
  +	
  +	// merge new parameters with existing parameters
  +	if (newParameters != null)
  +	    parameters = RequestUtil.mergeParameters(newParameters, parameters);
  +    }
       
  +
  +    /**
  +     * Replaces the query string without processing the parameters. 
  +     * Used by the RequestDispatcherImpl to restore the original 
  +     * query string. 
  +     *
  +     * @param inQueryString queryString to replace
  +     */
  +    public void replaceQueryString(String inQueryString) {
  +	this.queryString = inQueryString;
  +    }
  +    
  +	
       public void setRequestedSessionId(String reqSessionId) {
   	this.reqSessionId = reqSessionId;
       }
  
  
  
  1.2.2.1   +20 -42    jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java
  
  Index: RequestDispatcherImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- RequestDispatcherImpl.java	1999/11/03 20:38:52	1.2
  +++ RequestDispatcherImpl.java	2000/02/06 20:40:43	1.2.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java,v
1.2 1999/11/03 20:38:52 costin Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/11/03 20:38:52 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java,v
1.2.2.1 2000/02/06 20:40:43 akv Exp $
  + * $Revision: 1.2.2.1 $
  + * $Date: 2000/02/06 20:40:43 $
    *
    * ====================================================================
    * 
  @@ -66,6 +66,7 @@
   
   import org.apache.tomcat.util.StringManager;
   import java.io.*;
  +import java.util.*;
   import javax.servlet.*;
   import javax.servlet.http.*;
   
  @@ -75,6 +76,7 @@
    * @author James Duncan Davidson [duncan@eng.sun.com]
    * @author Jason Hunter [jch@eng.sun.com]
    * @author James Todd [gonzo@eng.sun.com]
  + * @author Alex Cruikshank [alex@epitonic.com]
    */
   
   public class RequestDispatcherImpl implements RequestDispatcher {
  @@ -113,23 +115,12 @@
   	ForwardedRequest fRequest =
   	    new ForwardedRequest(realRequest, urlPath);
   
  -        // join the query strings of the destination request
  -        // with the originaing request in that order.
  -
  -        String aggregatedQueryString = this.queryString;
  -
  -        if (realRequest.getQueryString() != null &&
  -            realRequest.getQueryString().trim().length() > 0) {
  -            if (aggregatedQueryString == null) {
  -                aggregatedQueryString = realRequest.getQueryString();
  -            } else {
  -                aggregatedQueryString += "&" + realRequest.getQueryString();
  -            }
  -        }
  -
  +	// add new query string parameters to request
  +	// if names are duplicates, new valeus will be prepended to arrays
  +	reqFacade.getRealRequest().addQueryString(queryString);
  +	
           fRequest.setServletPath(this.lookupResult.getServletPath());
   	fRequest.setPathInfo(this.lookupResult.getPathInfo());
  -        fRequest.setQueryString(aggregatedQueryString);
   
   	this.lookupResult.getWrapper().handleRequest(fRequest, resFacade);
       }
  @@ -161,6 +152,7 @@
           Request realRequest = reqFacade.getRealRequest();
   	Response realResponse = resFacade.getRealResponse();
           String originalQueryString = realRequest.getQueryString();
  +	Hashtable originalParameters = realRequest.getParametersCopy();
   
   	// XXX
   	// not sure why we're pre-pending context.getPath() here
  @@ -185,38 +177,24 @@
   	    req.setAttribute(Constants.Attribute.PathInfo,
                   lookupResult.getPathInfo());
   	}
  -
  -        // join the query strings of the destination request
  -        // with the originaing request in that order.
  -
  -        String aggregatedQueryString = this.queryString;
   
  -        if (realRequest.getQueryString() != null &&
  -            realRequest.getQueryString().trim().length() > 0) {
  -            if (aggregatedQueryString == null) {
  -                aggregatedQueryString = realRequest.getQueryString();
  -            } else {
  -                aggregatedQueryString += "&" + realRequest.getQueryString();
  -            }
  -        }
  +	// add new query string parameters to request
  +	// if names are duplicates, new values will be prepended to arrays
  +	reqFacade.getRealRequest().addQueryString( this.queryString );
  +	
   
  -	if (aggregatedQueryString != null) {
  +	if (reqFacade.getRealRequest().getQueryString() != null) {
   	    req.setAttribute(Constants.Attribute.QueryString,
  -                aggregatedQueryString);
  +			     reqFacade.getRealRequest().getQueryString());
   	}
  -
  -        // inline the aggregated query string for the scope
  -        // of the include
  -
  -	reqFacade.getRealRequest().setQueryString(aggregatedQueryString);
   	
   	IncludedResponse iResponse = new IncludedResponse(realResponse);
   
   	lookupResult.getWrapper().handleRequest(reqFacade, iResponse);
  -
  -        // revert the query string to its original value
  -
  -        reqFacade.getRealRequest().setQueryString(originalQueryString);
  +	
  +	// revert the parameters and query string to its original value
  +	reqFacade.getRealRequest().setParameters(originalParameters);
  +	reqFacade.getRealRequest().replaceQueryString(originalQueryString);
   
   	if (request_uri != null) {
   	    req.setAttribute(Constants.Attribute.RequestURI, request_uri);
  
  
  
  1.4.2.2   +8 -7      jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java
  
  Index: Response.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- Response.java	2000/02/03 02:57:45	1.4.2.1
  +++ Response.java	2000/02/06 20:40:43	1.4.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v 1.4.2.1
2000/02/03 02:57:45 mandar Exp $
  - * $Revision: 1.4.2.1 $
  - * $Date: 2000/02/03 02:57:45 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v 1.4.2.2
2000/02/06 20:40:43 akv Exp $
  + * $Revision: 1.4.2.2 $
  + * $Date: 2000/02/06 20:40:43 $
    *
    * ====================================================================
    *
  @@ -76,6 +76,7 @@
    * @author Jason Hunter [jch@eng.sun.com]
    * @author James Todd [gonzo@eng.sun.com]
    * @author Harish Prabandham
  + * @author Hans Bergsten <hans@gefionsoftware.com>
    */
   public class Response {
       protected StringManager sm =
  @@ -356,14 +357,14 @@
           cookieEnum = systemCookies.elements();
           while (cookieEnum.hasMoreElements()) {
               Cookie c  = (Cookie)cookieEnum.nextElement();
  -            headers.putHeader( CookieTools.getCookieHeaderName(c),
  +            headers.addHeader( CookieTools.getCookieHeaderName(c),
   			       CookieTools.getCookieHeaderValue(c));
   	    if( c.getVersion() == 1 ) {
   		// add a version 0 header too.
   		// XXX what if the user set both headers??
   		Cookie c0 = (Cookie)c.clone();
   		c0.setVersion(0);            
  -		headers.putHeader( CookieTools.getCookieHeaderName(c0),
  +		headers.addHeader( CookieTools.getCookieHeaderName(c0),
   				   CookieTools.getCookieHeaderValue(c0));
   	    }
           }
  @@ -371,14 +372,14 @@
           cookieEnum = userCookies.elements();
           while (cookieEnum.hasMoreElements()) {
               Cookie c  = (Cookie)cookieEnum.nextElement();
  -            headers.putHeader( CookieTools.getCookieHeaderName(c),
  +            headers.addHeader( CookieTools.getCookieHeaderName(c),
   			       CookieTools.getCookieHeaderValue(c));
   	    if( c.getVersion() == 1 ) {
   		// add a version 0 header too.
   		// XXX what if the user set both headers??
   		Cookie c0 = (Cookie)c.clone();
   		c0.setVersion(0);            
  -		headers.putHeader( CookieTools.getCookieHeaderName(c0),
  +		headers.addHeader( CookieTools.getCookieHeaderName(c0),
   				   CookieTools.getCookieHeaderValue(c0));
   	    }
           }
  
  
  

Mime
View raw message