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 RequestImpl.java
Date Sat, 23 Oct 1999 04:20:19 GMT
gonzo       99/10/22 21:20:19

  Modified:    src/share/org/apache/tomcat/core Tag: TOMCAT_J2EE_10F_102199
                        RequestDispatcherImpl.java RequestImpl.java
  Log:
  support for jsp/request.getParameter() for
  RequestDispachter.include()/forward()
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +38 -41    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
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- RequestDispatcherImpl.java	1999/10/09 00:30:15	1.1
  +++ RequestDispatcherImpl.java	1999/10/23 04:20:18	1.1.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java,v
1.1 1999/10/09 00:30:15 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:30:15 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestDispatcherImpl.java,v
1.1.2.1 1999/10/23 04:20:18 gonzo Exp $
  + * $Revision: 1.1.2.1 $
  + * $Date: 1999/10/23 04:20:18 $
    *
    * ====================================================================
    * 
  @@ -90,34 +90,6 @@
       RequestDispatcherImpl(Context context) {
           this.context = context;
       }
  -
  -    void setName(String name) {
  -        this.name = name;
  -	this.lookupResult =
  -	    context.getContainer().lookupServletByName(this.name);
  -    }
  -
  -    void setPath(String urlPath) {
  -	int i = urlPath.indexOf("?");
  -
  -	if (i > -1) {
  -	    try {
  -		this.queryString =
  -                    urlPath.substring(i + 1, urlPath.length());
  -	    } catch (Exception e) {
  -	    }
  -
  -	    urlPath = urlPath.substring(0, i);
  -	}
  -
  -	this.urlPath = urlPath;
  -	this.lookupResult =
  -	    context.getContainer().lookupServlet(this.urlPath);
  -    }
  -
  -    public boolean isValid() {
  -        return (this.lookupResult != null);
  -    }
       
       public void forward(ServletRequest request, ServletResponse response)
       throws ServletException, IOException {
  @@ -125,12 +97,8 @@
   	    (HttpServletRequestFacade)request;
   	HttpServletResponseFacade resFacade =
   	    (HttpServletResponseFacade)response;
  -
  -	Request realRequest = null;
  -	Response realResponse = null;
  -
  -        realRequest = reqFacade.getRealRequest();
  -        realResponse = resFacade.getRealResponse();
  +        Request realRequest = reqFacade.getRealRequest();
  +        Response realResponse = resFacade.getRealResponse();
   
   	if (realResponse.isStarted()) {
               String msg = sm.getString("rdi.forward.ise");
  @@ -166,15 +134,16 @@
   	String path_info =
               (String)req.getAttribute(Constants.Attribute.PathInfo);
   	String query_string =
  -            (String)req.getAttribute(Constants.Attribute.QueryString);
  +	    (String)req.getAttribute(Constants.Attribute.QueryString);
   	
   	HttpServletRequestFacade reqFacade =
   	    (HttpServletRequestFacade)request;
   	HttpServletResponseFacade resFacade =
   	    (HttpServletResponseFacade)response;
  -	Request realRequest = reqFacade.getRealRequest();
   	Response realResponse = resFacade.getRealResponse();
   
  +	reqFacade.getRealRequest().setQueryString(this.queryString);
  +
   	// XXX
   	// not sure why we're pre-pending context.getPath() here
   	//req.setAttribute(Constants.Attribute.RequestURI,
  @@ -199,9 +168,9 @@
                   lookupResult.getPathInfo());
   	}
   
  -	if (queryString != null) {
  +	if (this.queryString != null) {
   	    req.setAttribute(Constants.Attribute.QueryString,
  -                queryString);
  +                this.queryString);
   	}
   	
   	IncludedResponse iResponse = new IncludedResponse(realResponse);
  @@ -233,5 +202,33 @@
   	} else {
   	    reqFacade.removeAttribute(Constants.Attribute.QueryString);
   	}
  +    }
  +
  +    void setName(String name) {
  +        this.name = name;
  +	this.lookupResult =
  +	    context.getContainer().lookupServletByName(this.name);
  +    }
  +
  +    void setPath(String urlPath) {
  +	int i = urlPath.indexOf("?");
  +
  +	if (i > -1) {
  +	    try {
  +		this.queryString =
  +                    urlPath.substring(i + 1, urlPath.length());
  +	    } catch (Exception e) {
  +	    }
  +
  +	    urlPath = urlPath.substring(0, i);
  +	}
  +
  +	this.urlPath = urlPath;
  +	this.lookupResult =
  +	    context.getContainer().lookupServlet(this.urlPath);
  +    }
  +
  +    boolean isValid() {
  +        return (this.lookupResult != null);
       }
   }
  
  
  
  1.1.2.1   +9 -7      jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java
  
  Index: RequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- RequestImpl.java	1999/10/09 00:30:16	1.1
  +++ RequestImpl.java	1999/10/23 04:20:18	1.1.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java,v
1.1 1999/10/09 00:30:16 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:30:16 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java,v
1.1.2.1 1999/10/23 04:20:18 gonzo Exp $
  + * $Revision: 1.1.2.1 $
  + * $Date: 1999/10/23 04:20:18 $
    *
    * ====================================================================
    *
  @@ -345,12 +345,14 @@
   	this.requestURI=r;
       }
   
  -    public void setQueryString( String q ) {
  -	this.queryString=q;
  +    public void setQueryString(String queryString) {
  +	this.queryString = queryString;
  +
  +        setParameters(HttpUtils.parseQueryString(queryString));
       }
   
  -    public void setParameters( Hashtable h ) {
  -	this.parameters=h;
  +    public void setParameters(Hashtable parameters) {
  +	this.parameters = parameters;
       }
           
       public void setContentLength( int  len ) {
  
  
  

Mime
View raw message