tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core RequestDispatcherImpl.java
Date Sun, 31 Oct 1999 04:11:18 GMT
gonzo       99/10/30 21:11:17

  Modified:    src/share/org/apache/tomcat/core Tag: TOMCAT_J2EE_10F_102199
                        RequestDispatcherImpl.java
  Log:
  RequestDispatcher.include() with queryString aggregation/propogation - 4285199
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +34 -7     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.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- RequestDispatcherImpl.java	1999/10/30 09:23:56	1.1.2.2
  +++ RequestDispatcherImpl.java	1999/10/31 04:11:16	1.1.2.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java,v
1.1.2.2 1999/10/30 09:23:56 gonzo Exp $
  - * $Revision: 1.1.2.2 $
  - * $Date: 1999/10/30 09:23:56 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java,v
1.1.2.3 1999/10/31 04:11:16 gonzo Exp $
  + * $Revision: 1.1.2.3 $
  + * $Date: 1999/10/31 04:11:16 $
    *
    * ====================================================================
    * 
  @@ -137,6 +137,10 @@
       public void include(ServletRequest request, ServletResponse response)
       throws ServletException, IOException {
   	HttpServletRequest req = (HttpServletRequest)request;
  +
  +        // XXX
  +        // while this appears to work i believe the code
  +        // could be streamlined/normalized a bit.
   	
   	// if we are in a chained include, then we'll store the attributes
   	// from the last round so that we've got them for the next round
  @@ -154,10 +158,10 @@
   	    (HttpServletRequestFacade)request;
   	HttpServletResponseFacade resFacade =
   	    (HttpServletResponseFacade)response;
  +        Request realRequest = reqFacade.getRealRequest();
   	Response realResponse = resFacade.getRealResponse();
  +        String originalQueryString = realRequest.getQueryString();
   
  -	reqFacade.getRealRequest().setQueryString(this.queryString);
  -
   	// XXX
   	// not sure why we're pre-pending context.getPath() here
   	//req.setAttribute(Constants.Attribute.RequestURI,
  @@ -181,15 +185,38 @@
   	    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();
  +            }
  +        }
   
  -	if (this.queryString != null) {
  +	if (aggregatedQueryString != null) {
   	    req.setAttribute(Constants.Attribute.QueryString,
  -                this.queryString);
  +                aggregatedQueryString);
   	}
  +
  +        // 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);
   
   	if (request_uri != null) {
   	    req.setAttribute(Constants.Attribute.RequestURI, request_uri);
  
  
  

Mime
View raw message