tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core DummyRequest.java DummyResponse.java ApplicationContext.java StandardWrapper.java MappingRequest.java
Date Wed, 09 Oct 2002 08:01:12 GMT
remm        2002/10/09 01:01:12

  Modified:    catalina/src/share/org/apache/catalina/core
                        ApplicationContext.java StandardWrapper.java
  Added:       catalina/src/share/org/apache/catalina/core
                        DummyRequest.java DummyResponse.java
  Removed:     catalina/src/share/org/apache/catalina/core
                        MappingRequest.java
  Log:
  - Remove dependency on deprecated components.
  
  Revision  Changes    Path
  1.3       +6 -12     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationContext.java
  
  Index: ApplicationContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ApplicationContext.java	5 Sep 2002 12:06:08 -0000	1.2
  +++ ApplicationContext.java	9 Oct 2002 08:01:11 -0000	1.3
  @@ -149,7 +149,7 @@
           }
   
           public Object run() {
  -            HttpRequest request = new MappingRequest
  +            HttpRequest request = new DummyRequest
                   (context.getPath(), contextPath + relativeURI, queryString);
               Wrapper wrapper = (Wrapper) context.map(request, true);
               if (wrapper == null)
  @@ -604,14 +604,8 @@
   
           // The remaining code is duplicated in PrivilegedGetRequestDispatcher,
           // we need to make sure they stay in sync
  -        HttpRequest request = new MappingRequest
  +        HttpRequest request = new DummyRequest
               (context.getPath(), contextPath + relativeURI, queryString);
  -        /*
  -        request.setContext(context);
  -        request.setContextPath(context.getPath());
  -        request.setRequestURI(contextPath + relativeURI);
  -        request.setQueryString(queryString);
  -        */
           Wrapper wrapper = (Wrapper) context.map(request, true);
           if (wrapper == null)
               return (null);
  
  
  
  1.5       +6 -8      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java
  
  Index: StandardWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardWrapper.java	27 Sep 2002 07:13:05 -0000	1.4
  +++ StandardWrapper.java	9 Oct 2002 08:01:11 -0000	1.5
  @@ -93,8 +93,6 @@
   import org.apache.catalina.Wrapper;
   import javax.servlet.ServletRequest;
   import javax.servlet.ServletResponse;
  -import org.apache.catalina.connector.HttpRequestBase;
  -import org.apache.catalina.connector.HttpResponseBase;
   import org.apache.catalina.loader.StandardClassLoader;
   import org.apache.catalina.util.Enumerator;
   import org.apache.catalina.util.InstanceSupport;
  @@ -941,10 +939,10 @@
                   // Invoke jspInit on JSP pages
                   if ((loadOnStartup >= 0) && (jspFile != null)) {
                       // Invoking jspInit
  -                    HttpRequestBase req = new HttpRequestBase();
  -                    HttpResponseBase res = new HttpResponseBase();
  +                    DummyRequest req = new DummyRequest();
                       req.setServletPath(jspFile);
                       req.setQueryString("jsp_precompile=true");
  +                    DummyResponse res = new DummyResponse();
                       
                       if( System.getSecurityManager() != null) {
                           Class[] classType = new Class[]{ServletRequest.class, 
  
  
  
  1.1                  jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/DummyRequest.java
  
  Index: DummyRequest.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/DummyRequest.java,v
1.1 2002/10/09 08:01:11 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2002/10/09 08:01:11 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  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. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``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 APACHE SOFTWARE FOUNDATION 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.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  
  package org.apache.catalina.core;
  
  
  import java.io.BufferedReader;
  import java.io.InputStream;
  import java.io.IOException;
  import java.io.File;
  import java.io.UnsupportedEncodingException;
  import java.net.MalformedURLException;
  import java.net.Socket;
  import java.net.URL;
  import java.security.AccessController;
  import java.security.Principal;
  import java.security.PrivilegedAction;
  import java.security.PrivilegedExceptionAction;
  import java.security.PrivilegedActionException;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.Enumeration;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.Iterator;
  import java.util.Locale;
  import java.util.Map;
  import java.util.Set;
  import javax.naming.NamingException;
  import javax.naming.Binding;
  import javax.naming.directory.DirContext;
  import javax.servlet.RequestDispatcher;
  import javax.servlet.Servlet;
  import javax.servlet.ServletContext;
  import javax.servlet.ServletContextAttributeEvent;
  import javax.servlet.ServletContextAttributeListener;
  import javax.servlet.ServletInputStream;
  import javax.servlet.ServletRequest;
  import javax.servlet.http.Cookie;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpSession;
  import org.apache.naming.resources.Resource;
  import org.apache.naming.resources.DirContextURLStreamHandler;
  import org.apache.naming.resources.DirContextURLConnection;
  import org.apache.catalina.Connector;
  import org.apache.catalina.Container;
  import org.apache.catalina.Context;
  import org.apache.catalina.Globals;
  import org.apache.catalina.Host;
  import org.apache.catalina.HttpRequest;
  import org.apache.catalina.Logger;
  import org.apache.catalina.Response;
  import org.apache.catalina.Wrapper;
  import org.apache.catalina.deploy.ApplicationParameter;
  import org.apache.catalina.util.Enumerator;
  import org.apache.catalina.util.ResourceSet;
  import org.apache.catalina.util.ServerInfo;
  import org.apache.catalina.util.StringManager;
  
  
  /**
   * Dummy request object, used for request dispatcher mapping, as well as
   * JSP precompilation.
   *
   * @author Remy Maucherat
   * @version $Revision: 1.1 $ $Date: 2002/10/09 08:01:11 $
   */
  
  public class DummyRequest
      implements HttpRequest, HttpServletRequest {
  
      public DummyRequest() {
      }
  
      public DummyRequest(String contextPath, String decodedURI,
                          String queryString) {
          this.contextPath = contextPath;
          this.decodedURI = decodedURI;
          this.queryString = queryString;
      }
  
      protected String contextPath = null;
      protected String decodedURI = null;
      protected String queryString = null;
  
      protected String pathInfo = null;
      protected String servletPath = null;
      protected Wrapper wrapper = null;
  
      public String getContextPath() {
          return (contextPath);
      }
  
      public ServletRequest getRequest() {
          return (this);
      }
  
      public String getDecodedRequestURI() {
          return decodedURI;
      }
  
      public String getQueryString() {
          return queryString;
      }
  
      public void setQueryString(String query) {
          queryString = query;
      }
  
      public String getPathInfo() {
          return pathInfo;
      }
  
      public void setPathInfo(String path) {
          pathInfo = path;
      }
  
      public String getServletPath() {
          return servletPath;
      }
  
      public void setServletPath(String path) {
          servletPath = path;
      }
  
      public Wrapper getWrapper() {
          return (this.wrapper);
      }
  
      public void setWrapper(Wrapper wrapper) {
          this.wrapper = wrapper;
      }
  
      public String getAuthorization() { return null; }
      public void setAuthorization(String authorization) {}
      public Connector getConnector() { return null; }
      public void setConnector(Connector connector) {}
      public Context getContext() { return null; }
      public void setContext(Context context) {}
      public String getInfo() { return null; }
      public Response getResponse() { return null; }
      public void setResponse(Response response) {}
      public Socket getSocket() { return null; }
      public void setSocket(Socket socket) {}
      public InputStream getStream() { return null; }
      public void setStream(InputStream input) {}
      public void addLocale(Locale locale) {}
      public ServletInputStream createInputStream() throws IOException {
          return null;
      }
      public void finishRequest() throws IOException {}
      public Object getNote(String name) { return null; }
      public Iterator getNoteNames() { return null; }
      public void removeNote(String name) {}
      public void setContentType(String type) {}
      public void setNote(String name, Object value) {}
      public void setProtocol(String protocol) {}
      public void setRemoteAddr(String remoteAddr) {}
      public void setRemoteHost(String remoteHost) {}
      public void setScheme(String scheme) {}
      public void setServerName(String name) {}
      public void setServerPort(int port) {}
      public Object getAttribute(String name) { return null; }
      public Enumeration getAttributeNames() { return null; }
      public String getCharacterEncoding() { return null; }
      public int getContentLength() { return -1; }
      public void setContentLength(int length) {}
      public String getContentType() { return null; }
      public ServletInputStream getInputStream() throws IOException {
          return null;
      }
      public Locale getLocale() { return null; }
      public Enumeration getLocales() { return null; }
      public String getProtocol() { return null; }
      public BufferedReader getReader() throws IOException { return null; }
      public String getRealPath(String path) { return null; }
      public String getRemoteAddr() { return null; }
      public String getRemoteHost() { return null; }
      public String getScheme() { return null; }
      public String getServerName() { return null; }
      public int getServerPort() { return -1; }
      public boolean isSecure() { return false; }
      public void removeAttribute(String name) {}
      public void setAttribute(String name, Object value) {}
      public void setCharacterEncoding(String enc)
          throws UnsupportedEncodingException {}
      public void addCookie(Cookie cookie) {}
      public void addHeader(String name, String value) {}
      public void addParameter(String name, String values[]) {}
      public void clearCookies() {}
      public void clearHeaders() {}
      public void clearLocales() {}
      public void clearParameters() {}
      public void recycle() {}
      public void setAuthType(String authType) {}
      public void setContextPath(String path) {}
      public void setMethod(String method) {}
      public void setRequestedSessionCookie(boolean flag) {}
      public void setRequestedSessionId(String id) {}
      public void setRequestedSessionURL(boolean flag) {}
      public void setRequestURI(String uri) {}
      public void setSecure(boolean secure) {}
      public void setUserPrincipal(Principal principal) {}
      public String getParameter(String name) { return null; }
      public Map getParameterMap() { return null; }
      public Enumeration getParameterNames() { return null; }
      public String[] getParameterValues(String name) { return null; }
      public RequestDispatcher getRequestDispatcher(String path) {
          return null;
      }
      public String getAuthType() { return null; }
      public Cookie[] getCookies() { return null; }
      public long getDateHeader(String name) { return -1; }
      public String getHeader(String name) { return null; }
      public Enumeration getHeaders(String name) { return null; }
      public Enumeration getHeaderNames() { return null; }
      public int getIntHeader(String name) { return -1; }
      public String getMethod() { return null; }
      public String getPathTranslated() { return null; }
      public String getRemoteUser() { return null; }
      public String getRequestedSessionId() { return null; }
      public String getRequestURI() { return null; }
      public void setDecodedRequestURI(String uri) {}
      public StringBuffer getRequestURL() { return null; }
      public HttpSession getSession() { return null; }
      public HttpSession getSession(boolean create) { return null; }
      public boolean isRequestedSessionIdFromCookie() { return false; }
      public boolean isRequestedSessionIdFromURL() { return false; }
      public boolean isRequestedSessionIdFromUrl() { return false; }
      public boolean isRequestedSessionIdValid() { return false; }
      public boolean isUserInRole(String role) { return false; }
      public Principal getUserPrincipal() { return null; }
  
  
  }
  
  
  
  
  1.1                  jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/DummyResponse.java
  
  Index: DummyResponse.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/DummyResponse.java,v
1.1 2002/10/09 08:01:11 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2002/10/09 08:01:11 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  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. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``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 APACHE SOFTWARE FOUNDATION 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.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  
  package org.apache.catalina.core;
  
  
  import java.io.IOException;
  import java.io.OutputStream;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
  import java.util.Locale;
  import javax.servlet.ServletException;
  import javax.servlet.ServletOutputStream;
  import javax.servlet.ServletResponse;
  import javax.servlet.http.Cookie;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  import org.apache.catalina.Connector;
  import org.apache.catalina.Context;
  import org.apache.catalina.Request;
  import org.apache.catalina.HttpResponse;
  
  
  /**
   * Dummy response object, used for JSP precompilation.
   *
   * @author Remy Maucherat
   * @version $Revision: 1.1 $ $Date: 2002/10/09 08:01:11 $
   */
  
  public class DummyResponse
      implements HttpResponse, HttpServletResponse {
  
      public DummyResponse() {
      }
  
  
      public void setAppCommitted(boolean appCommitted) {}
      public boolean isAppCommitted() { return false; }
      public Connector getConnector() { return null; }
      public void setConnector(Connector connector) {}
      public int getContentCount() { return -1; }
      public Context getContext() { return null; }
      public void setContext(Context context) {}
      public boolean getIncluded() { return false; }
      public void setIncluded(boolean included) {}
      public String getInfo() { return null; }
      public Request getRequest() { return null; }
      public void setRequest(Request request) {}
      public ServletResponse getResponse() { return null; }
      public OutputStream getStream() { return null; }
      public void setStream(OutputStream stream) {}
      public void setSuspended(boolean suspended) {}
      public boolean isSuspended() { return false; }
      public void setError() {}
      public boolean isError() { return false; }
      public ServletOutputStream createOutputStream() throws IOException {
          return null;
      }
      public void finishResponse() throws IOException {}
      public int getContentLength() { return -1; }
      public String getContentType() { return null; }
      public PrintWriter getReporter() { return null; }
      public void recycle() {}
      public void write(int b) throws IOException {}
      public void write(byte b[]) throws IOException {}
      public void write(byte b[], int off, int len) throws IOException {}
      public void flushBuffer() throws IOException {}
      public int getBufferSize() { return -1; }
      public String getCharacterEncoding() { return null; }
      public void setCharacterEncoding(String charEncoding) {}
      public ServletOutputStream getOutputStream() throws IOException {
          return null;
      }
      public Locale getLocale() { return null; }
      public PrintWriter getWriter() throws IOException { return null; }
      public boolean isCommitted() { return false; }
      public void reset() {}
      public void resetBuffer() {}
      public void setBufferSize(int size) {}
      public void setContentLength(int length) {}
      public void setContentType(String type) {}
      public void setLocale(Locale locale) {}
  
      public Cookie[] getCookies() { return null; }
      public String getHeader(String name) { return null; }
      public String[] getHeaderNames() { return null; }
      public String[] getHeaderValues(String name) { return null; }
      public String getMessage() { return null; }
      public int getStatus() { return -1; }
      public void reset(int status, String message) {}
      public void addCookie(Cookie cookie) {}
      public void addDateHeader(String name, long value) {}
      public void addHeader(String name, String value) {}
      public void addIntHeader(String name, int value) {}
      public boolean containsHeader(String name) { return false; }
      public String encodeRedirectURL(String url) { return null; }
      public String encodeRedirectUrl(String url) { return null; }
      public String encodeURL(String url) { return null; }
      public String encodeUrl(String url) { return null; }
      public void sendAcknowledgement() throws IOException {}
      public void sendError(int status) throws IOException {}
      public void sendError(int status, String message) throws IOException {}
      public void sendRedirect(String location) throws IOException {}
      public void setDateHeader(String name, long value) {}
      public void setHeader(String name, String value) {}
      public void setIntHeader(String name, int value) {}
      public void setStatus(int status) {}
      public void setStatus(int status, String message) {}
  
  
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message