User: olegnitz
  Date: 02/01/16 17:23:17

  Added:       jetty/src/main/org/apache/jasper/servlet JasperLoader.java
                        JspCServletContext.java JspServlet.java
                        ServletEngine.java TomcatServletEngine.java
  Log:
  Jetty source files are in JBoss CVS now.
  Run "merge-mortbay-cvs" target to update them from Jetty CVS.
  Modified Jetty files (if such need will appear) must be explicitely listed in 
build.xml
  
  Revision  Changes    Path
  1.1                  
contrib/jetty/src/main/org/apache/jasper/servlet/JasperLoader.java
  
  Index: JasperLoader.java
  ===================================================================
  /*
   * ====================================================================
   * 
   * 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 [EMAIL PROTECTED]
   *
   * 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/>.
   *
   */ 
  
  package org.apache.jasper.servlet;
  
  import java.io.ByteArrayOutputStream;
  import java.io.InputStream;
  import java.io.IOException;
  import java.net.URL;
  import java.net.URLClassLoader;
  import java.security.AccessController;
  import java.security.CodeSource;
  import java.security.PermissionCollection;
  import java.security.PrivilegedAction;
  import java.security.ProtectionDomain;
  
  import org.apache.jasper.JasperException;
  import org.apache.jasper.Constants;
  import org.apache.jasper.JspCompilationContext;
  import org.apache.jasper.JspEngineContext;
  import org.apache.jasper.Options;
  import org.apache.jasper.compiler.Compiler;
  
  import org.apache.jasper.logging.Logger;
  import javax.servlet.http.*;
  /**
   * This is a class loader that loads JSP files as though they were
   * Java classes. It calls the compiler to compile the JSP file into a
   * servlet and then loads the generated class. 
   *
   * @author Anil K. Vijendran
   * @author Harish Prabandham
   */
  public class JasperLoader extends URLClassLoader {
  
      protected class PrivilegedLoadClass
          implements PrivilegedAction {
  
          PrivilegedLoadClass() {
          }
           
          public Object run() {
              return Thread.currentThread().getContextClassLoader();
          }
  
      }
  
      private PermissionCollection permissionCollection = null;
      private CodeSource codeSource = null;
      private String className = null;
      private ClassLoader parent = null;
      private SecurityManager securityManager = null;
      private PrivilegedLoadClass privLoadClass = null;
  
      JasperLoader(URL [] urls, String className, ClassLoader parent,
                 PermissionCollection permissionCollection,
                 CodeSource codeSource) {
        super(urls,parent);
        this.permissionCollection = permissionCollection;
        this.codeSource = codeSource;
        this.className = className;
        this.parent = parent;
          this.privLoadClass = new PrivilegedLoadClass();
        this.securityManager = System.getSecurityManager();
      }
  
      /**
       * Load the class with the specified name.  This method searches for
       * classes in the same manner as <code>loadClass(String, boolean)</code>
       * with <code>false</code> as the second argument.
       *
       * @param name Name of the class to be loaded
       *
       * @exception ClassNotFoundException if the class was not found
       */
      public Class loadClass(String name) throws ClassNotFoundException {
  
          return (loadClass(name, false));
  
      }
  
  
      /**
       * Load the class with the specified name, searching using the following
       * algorithm until it finds and returns the class.  If the class cannot
       * be found, returns <code>ClassNotFoundException</code>.
       * <ul>
       * <li>Call <code>findLoadedClass(String)</code> to check if the
       *     class has already been loaded.  If it has, the same
       *     <code>Class</code> object is returned.</li>
       * <li>If the <code>delegate</code> property is set to <code>true</code>,
       *     call the <code>loadClass()</code> method of the parent class
       *     loader, if any.</li>            
       * <li>Call <code>findClass()</code> to find this class in our locally
       *     defined repositories.</li>      
       * <li>Call the <code>loadClass()</code> method of our parent
       *     class loader, if any.</li>      
       * </ul>
       * If the class was found using the above steps, and the
       * <code>resolve</code> flag is <code>true</code>, this method will then
       * call <code>resolveClass(Class)</code> on the resulting Class object.
       *                                     
       * @param name Name of the class to be loaded
       * @param resolve If <code>true</code> then resolve the class
       *                                     
       * @exception ClassNotFoundException if the class was not found
       */                                    
      public Class loadClass(String name, boolean resolve)
          throws ClassNotFoundException {
  
          Class clazz = null;                
                                             
          // (0) Check our previously loaded class cache
          clazz = findLoadedClass(name);     
          if (clazz != null) {               
              if (resolve)                   
                  resolveClass(clazz);       
              return (clazz);        
          }                          
                            
          // (.5) Permission to access this class when using a SecurityManager
        int dot = name.lastIndexOf('.');
          if (System.getSecurityManager() != null) {     
              if (dot >= 0) {                
                  try {                    
                      securityManager.checkPackageAccess(name.substring(0,dot));
                  } catch (SecurityException se) {
                      String error = "Security Violation, attempt to use " +
                          "Restricted Class: " + name;
                      System.out.println(error);
                      throw new ClassNotFoundException(error);
                  }                          
              }                              
          }
  
        // Class is in a package, delegate to thread context class loader
        if( !name.startsWith(Constants.JSP_PACKAGE_NAME) ) {
              ClassLoader classLoader = null;
            if (System.getSecurityManager() != null) {
                   classLoader = 
(ClassLoader)AccessController.doPrivileged(privLoadClass);
              } else {
                classLoader = Thread.currentThread().getContextClassLoader();
              }
              clazz = classLoader.loadClass(name);
            if( resolve )
                resolveClass(clazz);
            return clazz;
        }
  
        // Only load classes for this JSP page
        if( name.startsWith(Constants.JSP_PACKAGE_NAME + "." + className) ) {
            String classFile = name.substring(Constants.JSP_PACKAGE_NAME.length()+1) +
                ".class";
            byte [] cdata = loadClassDataFromFile(classFile);
            if( cdata == null )
                throw new ClassNotFoundException(name);
            if( System.getSecurityManager() != null ) {
                ProtectionDomain pd = new ProtectionDomain(
                        codeSource,permissionCollection);
                clazz = defineClass(name,cdata,0,cdata.length,pd);
            } else {
                clazz = defineClass(name,cdata,0,cdata.length);
            }
            if( clazz != null ) {
                if( resolve )                
                    resolveClass(clazz);
                return clazz;
            }
        }
  
        throw new ClassNotFoundException(name);
      }
  
      /**
       * Get the Permissions for a CodeSource.
       *
       * Since this ClassLoader is only used for a JSP page in
       * a web application context, we just return our preset
       * PermissionCollection for the web app context.
       *
       * @param CodeSource where the code was loaded from
       * @return PermissionCollection for CodeSource
       */
      protected final PermissionCollection getPermissions(CodeSource codeSource) {
          return permissionCollection;
      }
  
  
      /**
       * Load JSP class data from file.
       */
      protected byte[] loadClassDataFromFile(String fileName) {
          byte[] classBytes = null;
          try {
              InputStream in = getResourceAsStream(fileName);
              if (in == null) {
                return null;
            }
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              byte buf[] = new byte[1024];
              for(int i = 0; (i = in.read(buf)) != -1; )
                  baos.write(buf, 0, i);
              in.close();     
              baos.close();    
              classBytes = baos.toByteArray();
          } catch(Exception ex) {
            ex.printStackTrace();
              return null;     
          }                    
          return classBytes;
      }
  
  }
  
  
  
  1.1                  
contrib/jetty/src/main/org/apache/jasper/servlet/JspCServletContext.java
  
  Index: JspCServletContext.java
  ===================================================================
  /*
   * ====================================================================
   * 
   * 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 [EMAIL PROTECTED]
   *
   * 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/>.
   *
   */ 
  
  package org.apache.jasper.servlet;
  
  
  import java.io.File;
  import java.io.InputStream;
  import java.io.IOException;
  import java.io.PrintWriter;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.util.Enumeration;
  import java.util.HashSet;
  import java.util.Hashtable;
  import java.util.Set;
  import java.util.Vector;
  import java.net.URL;
  import javax.servlet.RequestDispatcher;
  import javax.servlet.Servlet;
  import javax.servlet.ServletContext;
  import javax.servlet.ServletException;
  
  
  /**
   * Simple <code>ServletContext</code> implementation without
   * HTTP-specific methods.
   *
   * @author Peter Rossbach ([EMAIL PROTECTED])
   */
  
  public class JspCServletContext implements ServletContext {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * Servlet context attributes.
       */
      protected Hashtable myAttributes;
  
  
      /**
       * The log writer we will write log messages to.
       */
      protected PrintWriter myLogWriter;
  
  
      /**
       * The base URL (document root) for this context.
       */
      protected URL myResourceBaseURL;
  
  
      // ----------------------------------------------------------- Constructors
  
  
      /**
       * Create a new instance of this ServletContext implementation.
       *
       * @param aLogWriter PrintWriter which is used for <code>log()</code> calls
       * @param aResourceBaseURL Resource base URL
       */
      public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL) {
  
          myAttributes = new Hashtable();
          myLogWriter = aLogWriter;
          myResourceBaseURL = aResourceBaseURL;
  
      }
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Return the specified context attribute, if any.
       *
       * @param name Name of the requested attribute
       */
      public Object getAttribute(String name) {
  
          return (myAttributes.get(name));
  
      }
  
  
      /**
       * Return an enumeration of context attribute names.
       */
      public Enumeration getAttributeNames() {
  
          return (myAttributes.keys());
  
      }
  
  
      /**
       * Return the servlet context for the specified path.
       *
       * @param uripath Server-relative path starting with '/'
       */
      public ServletContext getContext(String uripath) {
  
          return (null);
  
      }
  
  
      /**
       * Return the specified context initialization parameter.
       *
       * @param name Name of the requested parameter
       */
      public String getInitParameter(String name) {
  
          return (null);
  
      }
  
  
      /**
       * Return an enumeration of the names of context initialization
       * parameters.
       */
      public Enumeration getInitParameterNames() {
  
          return (new Vector().elements());
  
      }
  
  
      /**
       * Return the Servlet API major version number.
       */
      public int getMajorVersion() {
  
          return (2);
  
      }
  
  
      /**
       * Return the MIME type for the specified filename.
       *
       * @param file Filename whose MIME type is requested
       */
      public String getMimeType(String file) {
  
          return (null);
  
      }
  
  
      /**
       * Return the Servlet API minor version number.
       */
      public int getMinorVersion() {
  
          return (3);
  
      }
  
  
      /**
       * Return a request dispatcher for the specified servlet name.
       *
       * @param name Name of the requested servlet
       */
      public RequestDispatcher getNamedDispatcher(String name) {
  
          return (null);
  
      }
  
  
      /**
       * Return the real path for the specified context-relative
       * virtual path.
       *
       * @param path The context-relative virtual path to resolve
       */
      public String getRealPath(String path) {
  
          if (!myResourceBaseURL.getProtocol().equals("file"))
              return (null);
          if (!path.startsWith("/"))
              return (null);
          try {
              return
                  (getResource(path).getFile().replace('/', File.separatorChar));
          } catch (Throwable t) {
              return (null);
          }
  
      }
              
              
      /**
       * Return a request dispatcher for the specified context-relative path.
       *
       * @param path Context-relative path for which to acquire a dispatcher
       */
      public RequestDispatcher getRequestDispatcher(String path) {
  
          return (null);
  
      }
  
  
      /**
       * Return a URL object of a resource that is mapped to the
       * specified context-relative path.
       *
       * @param path Context-relative path of the desired resource
       *
       * @exception MalformedURLException if the resource path is
       *  not properly formed
       */
      public URL getResource(String path) throws MalformedURLException {
  
          if (!path.startsWith("/"))
              throw new MalformedURLException("Path '" + path +
                                              "' does not start with '/'");
          return (new URL(myResourceBaseURL, path.substring(1)));
  
      }
  
  
      /**
       * Return an InputStream allowing access to the resource at the
       * specified context-relative path.
       *
       * @param path Context-relative path of the desired resource
       */
      public InputStream getResourceAsStream(String path) {
  
          try {
              return (getResource(path).openStream());
          } catch (Throwable t) {
              return (null);
          }
  
      }
  
  
      /**
       * Return the set of resource paths for the "directory" at the
       * specified context path.
       *
       * @param path Context-relative base path
       */
      public Set getResourcePaths(String path) {
  
          Set thePaths = new HashSet();
          if (!path.endsWith("/"))
              path += "/";
          String basePath = getRealPath(path);
          if (basePath == null)
              return (thePaths);
          File theBaseDir = new File(basePath);
          if (!theBaseDir.exists() || !theBaseDir.isDirectory())
              return (thePaths);
          String theFiles[] = theBaseDir.list();
          for (int i = 0; i < theFiles.length; i++) {
              File testFile = new File(basePath + File.separator + theFiles[i]);
              if (testFile.isFile())
                  thePaths.add(path + theFiles[i]);
              else if (testFile.isDirectory())
                  thePaths.add(path + theFiles[i] + "/");
          }
          return (thePaths);
  
      }
  
  
      /**
       * Return descriptive information about this server.
       */
      public String getServerInfo() {
  
          return ("JspCServletContext/1.0");
  
      }
  
  
      /**
       * Return a null reference for the specified servlet name.
       *
       * @param name Name of the requested servlet
       *
       * @deprecated This method has been deprecated with no replacement
       */
      public Servlet getServlet(String name) throws ServletException {
  
          return (null);
  
      }
  
  
      /**
       * Return the name of this servlet context.
       */
      public String getServletContextName() {
  
          return (getServerInfo());
  
      }
  
  
      /**
       * Return an empty enumeration of servlet names.
       *
       * @deprecated This method has been deprecated with no replacement
       */
      public Enumeration getServletNames() {
  
          return (new Vector().elements());
  
      }
  
  
      /**
       * Return an empty enumeration of servlets.
       *
       * @deprecated This method has been deprecated with no replacement
       */
      public Enumeration getServlets() {
  
          return (new Vector().elements());
  
      }
  
  
      /**
       * Log the specified message.
       *
       * @param message The message to be logged
       */
      public void log(String message) {
  
          myLogWriter.println(message);
  
      }
  
  
      /**
       * Log the specified message and exception.
       *
       * @param exception The exception to be logged
       * @param message The message to be logged
       *
       * @deprecated Use log(String,Throwable) instead
       */
      public void log(Exception exception, String message) {
  
          log(message, exception);
  
      }
  
  
      /**
       * Log the specified message and exception.
       *
       * @param message The message to be logged
       * @param exception The exception to be logged
       */
      public void log(String message, Throwable exception) {
  
          myLogWriter.println(message);
          exception.printStackTrace(myLogWriter);
  
      }
  
  
      /**
       * Remove the specified context attribute.
       *
       * @param name Name of the attribute to remove
       */
      public void removeAttribute(String name) {
  
          myAttributes.remove(name);
  
      }
  
  
      /**
       * Set or replace the specified context attribute.
       *
       * @param name Name of the context attribute to set
       * @param value Corresponding attribute value
       */
      public void setAttribute(String name, Object value) {
  
          myAttributes.put(name, value);
  
      }
  
  
  
  }
  
  
  
  1.1                  contrib/jetty/src/main/org/apache/jasper/servlet/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  /*
   * 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 [EMAIL PROTECTED]
   *
   * 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/>.
   *
   */ 
  
  package org.apache.jasper.servlet;
  
  import javax.servlet.Servlet;
  import javax.servlet.ServletContext;
  import javax.servlet.ServletConfig;
  import javax.servlet.ServletException;
  import javax.servlet.SingleThreadModel;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.jsp.HttpJspPage;
  import javax.servlet.jsp.JspFactory;
  
  import java.util.Hashtable;
  import java.util.Enumeration;
  import java.io.File;
  import java.io.PrintWriter;
  import java.io.IOException;
  import java.io.FileNotFoundException;
  import java.io.FilePermission;
  import java.lang.RuntimePermission;
  import java.net.URL;
  import java.net.URLClassLoader;
  import java.net.MalformedURLException;
  import java.security.AccessController;
  import java.security.CodeSource;
  import java.security.PermissionCollection;
  import java.security.Policy;
  import java.security.PrivilegedAction;
  
  import org.apache.jasper.JasperError;
  import org.apache.jasper.JasperException;
  import org.apache.jasper.Constants;
  import org.apache.jasper.Options;
  import org.apache.jasper.EmbededServletOptions;
  import org.apache.jasper.JspCompilationContext;
  import org.apache.jasper.JspEngineContext;
  import org.apache.jasper.compiler.Mangler;
  import org.apache.jasper.runtime.*;
  
  import org.apache.jasper.compiler.Compiler;
  import org.apache.jasper.compiler.TldLocationsCache;
  
  import org.apache.jasper.logging.Logger;
  import org.apache.jasper.logging.DefaultLogger;
  import org.apache.jasper.logging.JasperLogger;
  
  /**
   * The JSP engine (a.k.a Jasper)! 
   *
   * The servlet container is responsible for providing a
   * URLClassLoader for the web application context Jasper
   * is being used in. Jasper will try get the Tomcat
   * ServletContext attribute for its ServletContext class
   * loader, if that fails, it uses the parent class loader.
   * In either case, it must be a URLClassLoader.
   *
   * @author Anil K. Vijendran
   * @author Harish Prabandham
   */
  public class JspServlet extends HttpServlet {
  
      Logger.Helper loghelper;
  
      class JspServletWrapper {
          Servlet theServlet;
        String jspUri;
        boolean isErrorPage;
        // ServletWrapper will set this 
        Class servletClass;
        URLClassLoader loader = null;
        
        JspServletWrapper(String jspUri, boolean isErrorPage) {
            this.jspUri = jspUri;
            this.isErrorPage = isErrorPage;
            this.theServlet = null;
        }
        
        private void load() throws JasperException, ServletException {
            try {
                // This is to maintain the original protocol.
                destroy();
  
                theServlet = (Servlet) servletClass.newInstance();
            } catch (Exception ex) {
                throw new JasperException(ex);
            }
            theServlet.init(JspServlet.this.config);
  /*    Shouldn't be needed after switching to URLClassLoader
            if (theServlet instanceof HttpJspBase)  {
                  HttpJspBase h = (HttpJspBase) theServlet;
                  h.setClassLoader(JspServlet.this.parentClassLoader);
            }
  */
        }
        
        private void loadIfNecessary(HttpServletRequest req, HttpServletResponse res) 
              throws JasperException, ServletException, FileNotFoundException 
          {
              // First try context attribute; if that fails then use the 
              // classpath init parameter. 
  
              // Should I try to concatenate them if both are non-null?
  
              String cp = (String) context.getAttribute(Constants.SERVLET_CLASSPATH);
  
              String accordingto;
  
              if (cp == null || cp.equals("")) {
                  accordingto = "according to the init parameter";
                  cp = options.getClassPath();
              } else 
                  accordingto = "according to the Servlet Engine";
              
              Constants.message("jsp.message.cp_is", 
                                new Object[] { 
                                    accordingto,
                                    cp == null ? "" : cp
                                }, 
                                Logger.INFORMATION);
  
              if (loadJSP(jspUri, cp, isErrorPage, req, res) 
                      || theServlet == null) {
                  load();
              }
        }
        
        public void service(HttpServletRequest request, 
                            HttpServletResponse response,
                            boolean precompile)
            throws ServletException, IOException, FileNotFoundException 
        {
              try {
                  loadIfNecessary(request, response);
  
                // If a page is to only to be precompiled return.
                if (precompile)
                    return;
  
                if (theServlet instanceof SingleThreadModel) {
                    // sync on the wrapper so that the freshness
                    // of the page is determined right before servicing
                    synchronized (this) {
                        theServlet.service(request, response);
                    }
                } else {
                    theServlet.service(request, response);
                }
  
              } catch (FileNotFoundException ex) {
                  String includeRequestUri = (String)
                      request.getAttribute("javax.servlet.include.request_uri");
                  if (includeRequestUri != null) {
                      // This file was included. Throw an exception as
                      // a response.sendError() will be ignored by the
                      // servlet engine.
                      throw new ServletException(ex);
                  } else {
                      try {
                        response.sendError(HttpServletResponse.SC_NOT_FOUND, 
                                           ex.getMessage());
                    } catch (IllegalStateException ise) {
                        Constants.jasperLog.log(Constants.getString
                                                ("jsp.error.file.not.found",
                                                 new Object[] {
                                                     ex.getMessage()
                                                 }), ex,
                                                Logger.ERROR);
                    }
                    return;
                }
            }
        }
  
        public void destroy() {
            if (theServlet != null)
                theServlet.destroy();
        }
      }
        
        
      protected ServletContext context = null;
      protected Hashtable jsps = new Hashtable();
      protected ServletConfig config;
      protected Options options;
      protected URLClassLoader parentClassLoader;
      protected ServletEngine engine;
      protected String serverInfo;
      private PermissionCollection permissionCollection = null;
      private CodeSource codeSource = null;
  
      static boolean firstTime = true;
  
      public void init(ServletConfig config)
        throws ServletException
      {
        super.init(config);
        this.config = config;
        this.context = config.getServletContext();
          this.serverInfo = context.getServerInfo();
          
        // Setup logging 
          //        Constants.jasperLog = new JasperLogger(this.context);
          Constants.jasperLog = new DefaultLogger(this.context);
        Constants.jasperLog.setName("JASPER_LOG");
        Constants.jasperLog.setTimestamp("false");
        Constants.jasperLog.setVerbosityLevel(
                   config.getInitParameter("logVerbosityLevel"));
        loghelper = new Logger.Helper("JASPER_LOG", "JspServlet");
  
        options = new EmbededServletOptions(config, context);
  
        // Get the parent class loader
        parentClassLoader =
            (URLClassLoader) Thread.currentThread().getContextClassLoader();
          if (parentClassLoader == null)
              parentClassLoader = (URLClassLoader)this.getClass().getClassLoader();
          if (parentClassLoader != null) {
              Constants.message("jsp.message.parent_class_loader_is",
                                new Object[] {
                                    parentClassLoader.toString()
                                }, Logger.DEBUG);
              }
          else {
              Constants.message("jsp.message.parent_class_loader_is",
                                new Object[] {
                                    "<none>"  
                                }, Logger.DEBUG);
          }
  
        // Setup the PermissionCollection for this web app context
        // based on the permissions configured for the root of the
        // web app context directory, then add a file read permission
        // for that directory.
        Policy policy = Policy.getPolicy();
        if( policy != null ) {
              try {          
                // Get the permissions for the web app context
                  String contextDir = context.getRealPath("/");
                  if( contextDir == null )
                      contextDir = options.getScratchDir().toString();
                URL url = new URL("file:" + contextDir);
                codeSource = new CodeSource(url,null);
                permissionCollection = policy.getPermissions(codeSource);
                // Create a file read permission for web app context directory
                if (contextDir.endsWith(File.separator))
                    contextDir = contextDir + "-";
                else
                    contextDir = contextDir + File.separator + "-";
                permissionCollection.add( new FilePermission(contextDir,"read") );
                // Allow the JSP to access org.apache.jasper.runtime.HttpJspBase
                permissionCollection.add( new RuntimePermission(
                    "accessClassInPackage.org.apache.jasper.runtime") );
                  if (parentClassLoader instanceof URLClassLoader) {
                      URL [] urls = parentClassLoader.getURLs();
                      String jarUrl = null;
                      String jndiUrl = null;
                      for (int i=0; i<urls.length; i++) {
                          if (jndiUrl == null && 
urls[i].toString().startsWith("jndi:") ) {
                              jndiUrl = urls[i].toString() + "-";
                          }
                          if (jarUrl == null && 
urls[i].toString().startsWith("jar:jndi:") ) {
                              jarUrl = urls[i].toString();
                              jarUrl = jarUrl.substring(0,jarUrl.length() - 2);
                              jarUrl = jarUrl.substring(0,jarUrl.lastIndexOf('/')) + 
"/-";
                          }
                      }
                      if (jarUrl != null) {
                          permissionCollection.add( new FilePermission(jarUrl,"read") 
);
                          permissionCollection.add( new 
FilePermission(jarUrl.substring(4),"read") );
                      }
                      if (jndiUrl != null)
                          permissionCollection.add( new FilePermission(jndiUrl,"read") 
);
                  }
            } catch(MalformedURLException mfe) {
            }
        }
  
        if (firstTime) {
            firstTime = false;
            if( System.getSecurityManager() != null ) {
                // Make sure classes needed at runtime by a JSP servlet
                // are already loaded by the class loader so that we
                // don't get a defineClassInPackage security exception.
                String basePackage = "org.apache.jasper.";
                try {
                    parentClassLoader.loadClass( basePackage +
                        "runtime.JspFactoryImpl$PrivilegedGetPageContext");
                    parentClassLoader.loadClass( basePackage +
                        "runtime.JspFactoryImpl$PrivilegedReleasePageContext");
                    parentClassLoader.loadClass( basePackage +
                        "runtime.JspRuntimeLibrary");
                      parentClassLoader.loadClass( basePackage +
                          "runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
                      parentClassLoader.loadClass( basePackage +
                        "runtime.ServletResponseWrapperInclude");
                    this.getClass().getClassLoader().loadClass( basePackage +
                          "servlet.JspServlet$JspServletWrapper");
                } catch (ClassNotFoundException ex) {
                    System.out.println(
                        "Jasper JspServlet preload of class failed: " +
                        ex.getMessage());
                }
            }
            Constants.message("jsp.message.scratch.dir.is", 
                              new Object[] { 
                                  options.getScratchDir().toString() 
                              }, Logger.INFORMATION );
            Constants.message("jsp.message.dont.modify.servlets", Logger.INFORMATION);
            JspFactory.setDefaultFactory(new JspFactoryImpl());
        }
      }
  
      private void serviceJspFile(HttpServletRequest request, 
                                        HttpServletResponse response, String jspUri, 
                                Throwable exception, boolean precompile) 
        throws ServletException, IOException
      {
        boolean isErrorPage = exception != null;
        
        JspServletWrapper wrapper = (JspServletWrapper) jsps.get(jspUri);
        if (wrapper == null) {
            wrapper = new JspServletWrapper(jspUri, isErrorPage);
            jsps.put(jspUri, wrapper);
        }
        
        wrapper.service(request, response, precompile);
      }
  
  
      /**
       * <p>Look for a <em>precompilation request</em> as described in
       * Section 8.4.2 of the JSP 1.2 Specification.  <strong>WARNING</strong> -
       * we cannot use <code>request.getParameter()</code> for this, because
       * that will trigger parsing all of the request parameters, and not give
       * a servlet the opportunity to call
       * <code>request.setCharacterEncoding()</code> first.</p>
       *
       * @param request The servlet requset we are processing
       *
       * @exception ServletException if an invalid parameter value for the
       *  <code>jsp_precompile</code> parameter name is specified
       */
      boolean preCompile(HttpServletRequest request) 
          throws ServletException 
      {
  
          String queryString = request.getQueryString();
          if (queryString == null)
              return (false);
          int start = queryString.indexOf(Constants.PRECOMPILE);
          if (start < 0)
              return (false);
          queryString =
              queryString.substring(start + Constants.PRECOMPILE.length());
          if (queryString.length() == 0)
              return (true);             // ?jsp_precompile
          if (queryString.startsWith("&"))
              return (true);             // ?jsp_precompile&foo=bar...
          if (!queryString.startsWith("="))
              return (false);            // part of some other name or value
          int limit = queryString.length();
          int ampersand = queryString.indexOf("&");
          if (ampersand > 0)
              limit = ampersand;
          String value = queryString.substring(1, limit);
          if (value.equals("true"))
              return (true);             // ?jsp_precompile=true
          else if (value.equals("false"))
              return (true);             // ?jsp_precompile=false
          else
              throw new ServletException("Cannot have request parameter " +
                                         Constants.PRECOMPILE + " set to " +
                                         value);
  
      }
      
      
  
      public void service (HttpServletRequest request, 
                         HttpServletResponse response)
        throws ServletException, IOException
      {
        try {
              String includeUri 
                  = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
  
              String jspUri;
  
              if (includeUri == null)
                jspUri = request.getServletPath();
              else
                  jspUri = includeUri;
              String jspFile = (String) request.getAttribute(Constants.JSP_FILE);
              if (jspFile != null)
                  jspUri = jspFile;
  
              boolean precompile = preCompile(request);
  
            Logger jasperLog = Constants.jasperLog;
            
              if (jasperLog != null &&
                jasperLog.matchVerbosityLevel(Logger.INFORMATION))
                {
                    jasperLog.log("JspEngine --> "+jspUri);
                    jasperLog.log("\t     ServletPath: "+request.getServletPath());
                    jasperLog.log("\t        PathInfo: "+request.getPathInfo());
                    jasperLog.log("\t        RealPath: "
                                  
+getServletConfig().getServletContext().getRealPath(jspUri));
                    jasperLog.log("\t      RequestURI: "+request.getRequestURI());
                    jasperLog.log("\t     QueryString: "+request.getQueryString());
                    jasperLog.log("\t  Request Params: ");
                    Enumeration e = request.getParameterNames();
                    while (e.hasMoreElements()) {
                        String name = (String) e.nextElement();
                        jasperLog.log("\t\t "+name+" = "+request.getParameter(name));
                    }
                }
              serviceJspFile(request, response, jspUri, null, precompile);
        } catch (RuntimeException e) {
            throw e;
          } catch (JasperError ex) {
              response.getWriter().print(ex.getMessage());
        } catch (ServletException e) {
            throw e;
        } catch (IOException e) {
            throw e;
        } catch (Throwable e) {
            throw new ServletException(e);
        }
  
        // It's better to throw the exception - we don't
        // know if we can deal with sendError ( buffer may be
        // commited )
        // catch (Throwable t) {
        //          unknownException(response, t);
        //      }
      }
  
      public void destroy() {
        if (Constants.jasperLog != null)
            Constants.jasperLog.log("JspServlet.destroy()", Logger.INFORMATION);
  
        Enumeration servlets = jsps.elements();
        while (servlets.hasMoreElements()) 
            ((JspServletWrapper) servlets.nextElement()).destroy();
      }
  
  
      /*  Check if we need to reload a JSP page.
       *
       *  Side-effect: re-compile the JSP page.
       *
       *  @param classpath explicitly set the JSP compilation path.
       *  @return true if JSP files is newer
       */
      boolean loadJSP(String jspUri, String classpath, 
        boolean isErrorPage, HttpServletRequest req, HttpServletResponse res) 
        throws JasperException, FileNotFoundException 
      {
        // First check if the requested JSP page exists, to avoid creating
        // unnecessary directories and files.
        if (context.getResourceAsStream(jspUri) == null)
            throw new FileNotFoundException(jspUri);
  
        JspServletWrapper jsw=(JspServletWrapper) jsps.get(jspUri);
        if( jsw==null ) {
            throw new JasperException("Can't happen - JspServletWrapper=null");
        }
          File outDir = null;
          try {
              URL outURL = options.getScratchDir().toURL();
              String outURI = outURL.toString();
              if( outURI.endsWith("/") )
                  outURI = outURI + jspUri.substring(1,jspUri.lastIndexOf("/")+1);
              else
                  outURI = outURI + jspUri.substring(0,jspUri.lastIndexOf("/")+1);;
              outURL = new URL(outURI);
              outDir = new File(outURL.getFile());
              if( !outDir.exists() ) {
                  outDir.mkdirs();
              }
          } catch(Exception e) {
              throw new JasperException("No output directory: " + e.getMessage());
          }
        boolean firstTime = jsw.servletClass == null;
          JspCompilationContext ctxt = new JspEngineContext(parentClassLoader, 
classpath,
                                                       context, jspUri, 
outDir.toString() + File.separator,
                                                       isErrorPage, options,
                                                       req, res);
        boolean outDated = false; 
  
          Compiler compiler = ctxt.createCompiler();
          
          try {
              outDated = compiler.compile();
              if ( (jsw.servletClass == null) || (compiler.isOutDated()) ) {
                  synchronized ( this ) {
                      if ((jsw.servletClass == null) ||
                        (compiler.isOutDated() ))  {
                          outDated = compiler.compile();
                      }
                }
              }
          } catch (FileNotFoundException ex) {
              compiler.removeGeneratedFiles();
              throw ex;
          } catch (JasperException ex) {
              throw ex;
          } catch (Exception ex) {
            throw new JasperException(Constants.getString("jsp.error.unable.compile"),
                                        ex);
        }
  
        // Reload only if it's outdated
        if((jsw.servletClass == null) || outDated) {
            try {
                URL [] urls = new URL[1];
                  File outputDir = new File(normalize(ctxt.getOutputDir()));
                  urls[0] = outputDir.toURL();
                  jsw.loader = new JasperLoader(urls,ctxt.getServletClassName(),
                                              parentClassLoader,
                                              permissionCollection,
                                              codeSource);
                jsw.servletClass = jsw.loader.loadClass(
                        Constants.JSP_PACKAGE_NAME + "." + ctxt.getServletClassName());
            } catch (ClassNotFoundException cex) {
                throw new JasperException(
                    Constants.getString("jsp.error.unable.load"),cex);
            } catch (MalformedURLException mue) {
                  throw new JasperException(
                    Constants.getString("jsp.error.unable.load"),mue);
            }
            
        }
        
        return outDated;
      }
  
  
      /**
       * Determines whether the current JSP class is older than the JSP file
       * from whence it came
       */
      public boolean isOutDated(File jsp, JspCompilationContext ctxt,
                              Mangler mangler ) {
          File jspReal = null;
        boolean outDated;
        
          jspReal = new File(ctxt.getRealPath(jsp.getPath()));
  
          File classFile = new File(mangler.getClassFileName());
          if (classFile.exists()) {
              outDated = classFile.lastModified() < jspReal.lastModified();
          } else {
              outDated = true;
          }
  
          return outDated;
      }
  
  
      /**
       * Return a context-relative path, beginning with a "/", that represents
       * the canonical version of the specified path after ".." and "." elements
       * are resolved out.  If the specified path attempts to go outside the
       * boundaries of the current context (i.e. too many ".." path elements
       * are present), return <code>null</code> instead.
       *
       * @param path Path to be normalized
       */
      protected String normalize(String path) {
  
          if (path == null)
              return null;
  
          String normalized = path;
          
        // Normalize the slashes and add leading slash if necessary
        if (normalized.indexOf('\\') >= 0)
            normalized = normalized.replace('\\', '/');
        if (!normalized.startsWith("/"))
            normalized = "/" + normalized;
  
        // Resolve occurrences of "//" in the normalized path
        while (true) {
            int index = normalized.indexOf("//");
            if (index < 0)
                break;
            normalized = normalized.substring(0, index) +
                normalized.substring(index + 1);
        }
  
        // Resolve occurrences of "/./" in the normalized path
        while (true) {
            int index = normalized.indexOf("/./");
            if (index < 0)
                break;
            normalized = normalized.substring(0, index) +
                normalized.substring(index + 2);
        }
  
        // Resolve occurrences of "/../" in the normalized path
        while (true) {
            int index = normalized.indexOf("/../");
            if (index < 0)
                break;
            if (index == 0)
                return (null);  // Trying to go outside our context
            int index2 = normalized.lastIndexOf('/', index - 1);
            normalized = normalized.substring(0, index2) +
                normalized.substring(index + 3);
        }
  
        // Return the normalized path that we have completed
        return (normalized);
  
      }
  
  
  }
  
  
  
  1.1                  
contrib/jetty/src/main/org/apache/jasper/servlet/ServletEngine.java
  
  Index: ServletEngine.java
  ===================================================================
  /*
   * $Header: 
/cvsroot/jboss/contrib/jetty/src/main/org/apache/jasper/servlet/ServletEngine.java,v 
1.1 2002/01/17 01:23:17 olegnitz Exp $
   * $Revision: 1.1 $
   * $Date: 2002/01/17 01:23:17 $
   *
   * ====================================================================
   * 
   * 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 [EMAIL PROTECTED]
   *
   * 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/>.
   *
   */ 
  package org.apache.jasper.servlet;
  
  import java.io.File;
  
  import javax.servlet.ServletContext;
  
  /**
   * Simple class to factor out servlet runner dependencies from the JSP
   * engine. There's a few motivations here: 
   *
   *    (a) ability for the JSP engine to be able to run on multiple
   *          servlet engines - 2.1 and 2.2
   *    (b) ability for the JSP engine to take advantage of specific
   *          servlet engines; this is crucial from a J2EE point of
   *          view. 
   *
   * @author Anil K. Vijendran
   * @author Harish Prabandham
   */
  public class ServletEngine {
      static ServletEngine tomcat;
      static ServletEngine deflt;
      
      /**
       * Get a specific ServletEngine instance for the particular servlet runner
       * we are running on.
       */
      static ServletEngine getServletEngine(String serverInfo) {
          if (serverInfo.startsWith("Tomcat Web Server")) {
              if (tomcat == null) {
                  try {
                      tomcat = (ServletEngine)
                          
Class.forName("org.apache.jasper.runtime.TomcatServletEngine").newInstance();
                  } catch (Exception ex) {
                      return null;
                  }
              }
              return tomcat;
          } else {
              if (deflt == null) 
                  deflt = new ServletEngine();
              return deflt;
          }
      }
      
      /**
       * Get the class loader for this ServletContext object. 
       */
      public ClassLoader getClassLoader(ServletContext ctx) {
          return null;
      }
  }
  
  
  
  
  
  
  
  
  
  1.1                  
contrib/jetty/src/main/org/apache/jasper/servlet/TomcatServletEngine.java
  
  Index: TomcatServletEngine.java
  ===================================================================
  /*
   * $Header: 
/cvsroot/jboss/contrib/jetty/src/main/org/apache/jasper/servlet/TomcatServletEngine.java,v
 1.1 2002/01/17 01:23:17 olegnitz Exp $
   * $Revision: 1.1 $
   * $Date: 2002/01/17 01:23:17 $
   *
   * ====================================================================
   * 
   * 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 [EMAIL PROTECTED]
   *
   * 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/>.
   *
   */ 
  package org.apache.jasper.servlet;
  
  import java.io.File;
  import javax.servlet.ServletContext;
  
  /**
   * Implementation of Servlet Engine that is used when the JSP engine
   * is running with Tomcat. 
   *
   * @author Anil K. Vijendran
   */
  public class TomcatServletEngine extends ServletEngine {
      public ClassLoader getClassLoader(ServletContext ctx) {
          return null;// XXX (ClassLoader)((ServletContextFacade) 
ctx).getRealContext().getLoader();
      }
  }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to