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

  Added:       jetty/src/main/javax/servlet/jsp HttpJspPage.java
                        JspEngineInfo.java JspException.java
                        JspFactory.java JspPage.java JspTagException.java
                        JspWriter.java PageContext.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/javax/servlet/jsp/HttpJspPage.java
  
  Index: HttpJspPage.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 javax.servlet.jsp;
  
  import javax.servlet.*;
  import javax.servlet.http.*;
  import java.io.IOException;
  
  /**
   * The HttpJspPage interface describes the interaction that a JSP Page
   * Implementation Class must satisfy when using the HTTP protocol.
   *
   * <p>
   * The behaviour is identical to that of the JspPage, except for the signature
   * of the _jspService method, which is now expressible in the Java type
   * system and included explicitly in the interface.
   * 
   * @see JspPage
   */
  
  public interface HttpJspPage extends JspPage {
  
      /**
       * The _jspService()method corresponds to the body of the JSP page. This
       * method is defined automatically by the JSP container and should never
       * be defined by the JSP page author.
       * <p>
       * If a superclass is specified using the extends attribute, that
       * superclass may choose to perform some actions in its service() method
       * before or after calling the _jspService() method.  See using the extends
       * attribute in the JSP_Engine chapter of the JSP specification.
       */
      public void _jspService(HttpServletRequest request,
                                HttpServletResponse response)
         throws ServletException, IOException;
  }
  
  
  
  1.1                  contrib/jetty/src/main/javax/servlet/jsp/JspEngineInfo.java
  
  Index: JspEngineInfo.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 javax.servlet.jsp;
  
  /**
   * The JspEngineInfo is an abstract class that provides information on the
   * current JSP engine.
   */
  
  public abstract class JspEngineInfo {
      
      /**
       * Return the version number of the JSP specification that is supported by
       * this JSP engine.
       * <p>
       * Specification version numbers that consists of positive decimal integers
       * separated by periods ".", for example, "2.0" or "1.2.3.4.5.6.7".
       * This allows an extensible number to be used to
       * represent major, minor, micro, etc versions.
       * The version number must begin with a number.
       * </p>
       *
       * @return the specification version, null is returned if it is not known
       */
  
      public abstract String getSpecificationVersion();
  }
  
  
  
  1.1                  contrib/jetty/src/main/javax/servlet/jsp/JspException.java
  
  Index: JspException.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 javax.servlet.jsp;
  
  /**
   * A generic exception known to the JSP engine; uncaught
   * JspExceptions will result in an invocation of the errorpage
   * machinery.
   */
  
  public class JspException extends Exception {
  
      private Throwable rootCause;
  
  
      /**
       * Construct a JspException
       */
      public JspException() {
      }
  
  
      /**
       * Constructs a new JSP exception with the
       * specified message. The message can be written 
       * to the server log and/or displayed for the user. 
       *
       * @param msg             a <code>String</code> 
       *                                specifying the text of 
       *                                the exception message
       *
       */
      public JspException(String msg) {
        super(msg);
      }
  
  
      /**
       * Constructs a new JSP exception when the JSP 
       * needs to throw an exception and include a message 
       * about the "root cause" exception that interfered with its 
       * normal operation, including a description message.
       *
       *
       * @param message                 a <code>String</code> containing 
       *                                the text of the exception message
       *
       * @param rootCause               the <code>Throwable</code> exception 
       *                                that interfered with the servlet's
       *                                normal operation, making this servlet
       *                                exception necessary
       *
       */
      
      public JspException(String message, Throwable rootCause) {
        super(message);
        this.rootCause = rootCause;
      }
  
  
      /**
       * Constructs a new JSP exception when the JSP 
       * needs to throw an exception and include a message
       * about the "root cause" exception that interfered with its
       * normal operation.  The exception's message is based on the localized
       * message of the underlying exception.
       *
       * <p>This method calls the <code>getLocalizedMessage</code> method
       * on the <code>Throwable</code> exception to get a localized exception
       * message. When subclassing <code>JspException</code>, 
       * this method can be overridden to create an exception message 
       * designed for a specific locale.
       *
       * @param rootCause       the <code>Throwable</code> exception
       *                                that interfered with the JSP's
       *                                normal operation, making the JSP exception
       *                                necessary
       *
       */
  
      public JspException(Throwable rootCause) {
        super(rootCause.getLocalizedMessage());
        this.rootCause = rootCause;
      }
  
      
      /**
       * Returns the exception that caused this JSP exception.
       *
       *
       * @return                        the <code>Throwable</code> 
       *                                that caused this JSP exception
       *
       */
      
      public Throwable getRootCause() {
        return rootCause;
      }
  }
  
  
  
  1.1                  contrib/jetty/src/main/javax/servlet/jsp/JspFactory.java
  
  Index: JspFactory.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 javax.servlet.jsp;
  
  import javax.servlet.Servlet;
  import javax.servlet.ServletRequest;
  import javax.servlet.ServletResponse;
  import javax.servlet.jsp.PageContext;
  
  /**
   * <p>
   * The JspFactory is an abstract class that defines a number of factory
   * methods available to a JSP page at runtime for the purposes of creating
   * instances of various interfaces and classes used to support the JSP 
   * implementation.
   * <p>
   * A conformant JSP Engine implementation will, during it's initialization
   * instantiate an implementation dependent subclass of this class, and make 
   * it globally available for use by JSP implementation classes by registering
   * the instance created with this class via the
   * static <code> setDefaultFactory() </code> method.
   * <p>
   * The PageContext and the JspEngineInfo classes are the only 
implementation-dependent
   * classes that can be created from the factory.
   * <p>
   * JspFactory objects should not be used by JSP page authors.
   */
  
  public abstract class JspFactory {
  
      private static JspFactory deflt = null;
  
      /**
       * <p>
       * set the default factory for this implementation. It is illegal for
       * any principal other than the JSP Engine runtime to call this method.
       * </p>
       *
       * @param default The default factory implementation
       */
  
      public static synchronized void setDefaultFactory(JspFactory deflt) {
        JspFactory.deflt = deflt;
      }
  
      /**
       * @return the default factory for this implementation
       */
  
      public static synchronized JspFactory getDefaultFactory() {
        return deflt;
      }
  
      /**
       * <p>
       * obtains an instance of an implementation dependent 
       * javax.servlet.jsp.PageContext abstract class for the calling Servlet
       * and currently pending request and response.
       * </p>
       *
       * <p>
       * This method is typically called early in the processing of the 
       * _jspService() method of a JSP implementation class in order to 
       * obtain a PageContext object for the request being processed.
       * </p>
       * <p>
       * Invoking this method shall result in the PageContext.initialize()
       * method being invoked. The PageContext returned is properly initialized.
       * </p>
       * <p>
       * All PageContext objects obtained via this method shall be released
       * by invoking releasePageContext().
       * </p>
       *
       * @param servlet   the requesting servlet
       * @param config    the ServletConfig for the requesting Servlet
       * @param request the current request pending on the servlet
       * @param response        the current response pending on the servlet
       * @param errorPageURL the URL of the error page for the requesting JSP, or null
       * @param needsSession true if the JSP participates in a session
       * @param buffer  size of buffer in bytes, PageContext.NO_BUFFER if no buffer,
       *                        PageContext.DEFAULT_BUFFER if implementation default.
       * @param autoflush       should the buffer autoflush to the output stream on 
buffer
       *                        overflow, or throw an IOException?
       *
       * @return the page context
       *
       * @see javax.servlet.jsp.PageContext
       */
  
      public abstract PageContext getPageContext(Servlet               servlet,
                                               ServletRequest  request,
                                               ServletResponse response,
                                               String          errorPageURL,
                                               boolean         needsSession,
                                               int             buffer,
                                               boolean         autoflush);
  
      /**
       * <p>
       * called to release a previously allocated PageContext object.
       * Results in PageContext.release() being invoked.
       * This method should be invoked prior to returning from the _jspService() 
method of a JSP implementation
       * class.
       * </p>
       *
       * @param pc A PageContext previously obtained by getPageContext()
       */
  
      public abstract void releasePageContext(PageContext pc);
  
      /**
       * <p>
       * called to get implementation-specific information on the current JSP engine
       * </p>
       *
       * @return a JspEngineInfo object describing the current JSP engine
       */
      
      public abstract JspEngineInfo getEngineInfo();
  }
  
  
  
  1.1                  contrib/jetty/src/main/javax/servlet/jsp/JspPage.java
  
  Index: JspPage.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 javax.servlet.jsp;
  
  import javax.servlet.*;
  
  /**
   * The JspPage interface describes the generic interaction that a JSP Page
   * Implementation class must satisfy; pages that use the HTTP protocol
   * are described by the HttpJspPage interface.
   *
   * <p><B>Two plus One Methods</B>
   * <p>
   * The interface defines a protocol with 3 methods; only two of
   * them: jspInit() and jspDestroy() are part of this interface as
   * the signature of the third method: _jspService() depends on
   * the specific protocol used and cannot be expressed in a generic
   * way in Java.
   * <p>
   * A class implementing this interface is responsible for invoking
   * the above methods at the appropriate time based on the
   * corresponding Servlet-based method invocations.
   * <p>
   * The jspInit() and jspDestroy() methods can be defined by a JSP
   * author, but the _jspService() method is defined automatically
   * by the JSP processor based on the contents of the JSP page.
   *
   * <p><B>_jspService()</B>
   * <p>
   * The _jspService()method corresponds to the body of the JSP page. This
   * method is defined automatically by the JSP container and should never
   * be defined by the JSP page author.
   * <p>
   * If a superclass is specified using the extends attribute, that
   * superclass may choose to perform some actions in its service() method
   * before or after calling the _jspService() method.  See using the extends
   * attribute in the JSP_Engine chapter of the JSP specification.
   * <p>
   * The specific signature depends on the protocol supported by the JSP page.
   *
   * <pre>
   * public void _jspService(<em>ServletRequestSubtype</em> request,
   *                             <em>ServletResponseSubtype</em> response)
   *        throws ServletException, IOException;
   * </pre>
   */
  
  
  public interface JspPage extends Servlet {
  
      /**
       * The jspInit() method is invoked when the JSP page is initialized. It
       * is the responsibility of the JSP implementation (and of the class
       * mentioned by the extends attribute, if present) that at this point
       * invocations to the getServletConfig() method will return the desired
       * value.
       *
       * A JSP page can override this method by including a definition for it
       * in a declaration element.
       *
       * A JSP page should redefine the init() method from Servlet.
       */
      public void jspInit();
  
      /**
       * The jspDestroy() method is invoked when the JSP page is about to be
       * destroyed.
       * 
       * A JSP page can override this method by including a definition for it
       * in a declaration element.
       *
       * A JSP page should redefine the destroy() method from Servlet.
       */
      public void jspDestroy();
  
  }
  
  
  
  1.1                  contrib/jetty/src/main/javax/servlet/jsp/JspTagException.java
  
  Index: JspTagException.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 javax.servlet.jsp;
  
  /**
   * Exception to be used by a Tag Handler to indicate some unrecoverable
   * error.
   * This error is to be caught by the top level of the JSP page and will result
   * in an error page.
   */
  
  public class JspTagException extends JspException {
      /**
       * Constructor with a message.
       */
      public JspTagException(String msg) {
        super(msg);
      }
  
      /**
       * No message
       */
      public JspTagException() {
        super();
      }
  }
  
  
  
  1.1                  contrib/jetty/src/main/javax/servlet/jsp/JspWriter.java
  
  Index: JspWriter.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 javax.servlet.jsp;
  
  import java.io.IOException;
  
  /**
   * <p>
   * The actions and template data in a JSP page is written using the
   * JspWriter object that is referenced by the implicit variable out which
   * is initialized automatically using methods in the PageContext object.
   *<p>
   * This abstract class emulates some of the functionality found in the
   * java.io.BufferedWriter and java.io.PrintWriter classes,
   * however it differs in that it throws java.io.IOException from the print
   * methods while PrintWriter does not.
   * <p><B>Buffering</B>
   * <p>
   * The initial JspWriter object is associated with the PrintWriter object
   * of the ServletResponse in a way that depends on whether the page is or
   * is not buffered. If the page is not buffered, output written to this
   * JspWriter object will be written through to the PrintWriter directly,
   * which will be created if necessary by invoking the getWriter() method
   * on the response object. But if the page is buffered, the PrintWriter
   * object will not be created until the buffer is flushed and
   * operations like setContentType() are legal. Since this flexibility
   * simplifies programming substantially, buffering is the default for JSP
   * pages.
   * <p>
   * Buffering raises the issue of what to do when the buffer is
   * exceeded. Two approaches can be taken:
   * <ul>
   * <li>
   * Exceeding the buffer is not a fatal error; when the buffer is
   * exceeded, just flush the output.
   * <li>
   * Exceeding the buffer is a fatal error; when the buffer is exceeded,
   * raise an exception.
   * </ul>
   * <p>
   * Both approaches are valid, and thus both are supported in the JSP
   * technology. The behavior of a page is controlled by the autoFlush
   * attribute, which defaults to true. In general, JSP pages that need to
   * be sure that correct and complete data has been sent to their client
   * may want to set autoFlush to false, with a typical case being that
   * where the client is an application itself. On the other hand, JSP
   * pages that send data that is meaningful even when partially
   * constructed may want to set autoFlush to true; such as when the
   * data is sent for immediate display through a browser. Each application
   * will need to consider their specific needs.
   * <p>
   * An alternative considered was to make the buffer size unbounded; but,
   * this had the disadvantage that runaway computations would consume an
   * unbounded amount of resources.
   * <p>
   * The "out" implicit variable of a JSP implementation class is of this type.
   * If the page directive selects autoflush="true" then all the I/O operations
   * on this class shall automatically flush the contents of the buffer if an
   * overflow condition would result if the current operation were performed
   * without a flush. If autoflush="false" then all the I/O operations on this
   * class shall throw an IOException if performing the current operation would
   * result in a buffer overflow condition.
   *
   * @see java.io.Writer
   * @see java.io.BufferedWriter
   * @see java.io.PrintWriter
   */
  
  abstract public class JspWriter extends java.io.Writer {
  
      /**
       * constant indicating that the Writer is not buffering output
       */
  
      public static final int   NO_BUFFER = 0;
  
      /**
       * constant indicating that the Writer is buffered and is using the 
implementation default buffer size
       */
  
      public static final int   DEFAULT_BUFFER = -1;
  
      /**
       * constant indicating that the Writer is buffered and is unbounded; this is 
used in BodyContent
       */
  
      public static final int   UNBOUNDED_BUFFER = -2;
  
      /**
       * protected constructor.
       */
  
      protected JspWriter(int bufferSize, boolean autoFlush) {
        this.bufferSize = bufferSize;
        this.autoFlush  = autoFlush;
      }
  
      /**
       * Write a line separator.  The line separator string is defined by the
       * system property <tt>line.separator</tt>, and is not necessarily a single
       * newline ('\n') character.
       *
       * @exception  IOException  If an I/O error occurs
       */
  
      abstract public void newLine() throws IOException;
  
      /**
       * Print a boolean value.  The string produced by <code>{@link
       * java.lang.String#valueOf(boolean)}</code> is translated into bytes
       * according to the platform's default character encoding, and these bytes
       * are written in exactly the manner of the <code>{@link
       * #write(int)}</code> method.
       *
       * @param      b   The <code>boolean</code> to be printed
       * @throws           java.io.IOException
       */
  
      abstract public void print(boolean b) throws IOException;
  
      /**
       * Print a character.  The character is translated into one or more bytes
       * according to the platform's default character encoding, and these bytes
       * are written in exactly the manner of the <code>{@link
       * #write(int)}</code> method.
       *
       * @param      c   The <code>char</code> to be printed
       * @throws           java.io.IOException
       */
  
      abstract public void print(char c) throws IOException;
  
      /**
       * Print an integer.  The string produced by <code>{@link
       * java.lang.String#valueOf(int)}</code> is translated into bytes according
       * to the platform's default character encoding, and these bytes are
       * written in exactly the manner of the <code>{@link #write(int)}</code>
       * method.
       *
       * @param      i   The <code>int</code> to be printed
       * @see        java.lang.Integer#toString(int)
       * @throws           java.io.IOException
       */
  
      abstract public void print(int i) throws IOException;
  
      /**
       * Print a long integer.  The string produced by <code>{@link
       * java.lang.String#valueOf(long)}</code> is translated into bytes
       * according to the platform's default character encoding, and these bytes
       * are written in exactly the manner of the <code>{@link #write(int)}</code>
       * method.
       *
       * @param      l   The <code>long</code> to be printed
       * @see        java.lang.Long#toString(long)
       * @throws           java.io.IOException
       */
  
      abstract public void print(long l) throws IOException;
  
      /**
       * Print a floating-point number.  The string produced by <code>{@link
       * java.lang.String#valueOf(float)}</code> is translated into bytes
       * according to the platform's default character encoding, and these bytes
       * are written in exactly the manner of the <code>{@link #write(int)}</code>
       * method.
       *
       * @param      f   The <code>float</code> to be printed
       * @see        java.lang.Float#toString(float)
       * @throws           java.io.IOException
       */
  
      abstract public void print(float f) throws IOException;
  
      /**
       * Print a double-precision floating-point number.  The string produced by
       * <code>{@link java.lang.String#valueOf(double)}</code> is translated into
       * bytes according to the platform's default character encoding, and these
       * bytes are written in exactly the manner of the <code>{@link
       * #write(int)}</code> method.
       *
       * @param      d   The <code>double</code> to be printed
       * @see        java.lang.Double#toString(double)
       * @throws           java.io.IOException
       */
  
      abstract public void print(double d) throws IOException;
  
      /**
       * Print an array of characters.  The characters are converted into bytes
       * according to the platform's default character encoding, and these bytes
       * are written in exactly the manner of the <code>{@link #write(int)}</code>
       * method.
       *
       * @param      s   The array of chars to be printed
       *
       * @throws  NullPointerException  If <code>s</code> is <code>null</code>
       * @throws           java.io.IOException
       */
  
      abstract public void print(char s[]) throws IOException;
  
      /**
       * Print a string.  If the argument is <code>null</code> then the string
       * <code>"null"</code> is printed.  Otherwise, the string's characters are
       * converted into bytes according to the platform's default character
       * encoding, and these bytes are written in exactly the manner of the
       * <code>{@link #write(int)}</code> method.
       *
       * @param      s   The <code>String</code> to be printed
       * @throws           java.io.IOException
       */
  
      abstract public void print(String s) throws IOException;
  
      /**
       * Print an object.  The string produced by the <code>{@link
       * java.lang.String#valueOf(Object)}</code> method is translated into bytes
       * according to the platform's default character encoding, and these bytes
       * are written in exactly the manner of the <code>{@link #write(int)}</code>
       * method.
       *
       * @param      obj   The <code>Object</code> to be printed
       * @see        java.lang.Object#toString()
       * @throws           java.io.IOException
       */
  
      abstract public void print(Object obj) throws IOException;
  
      /**
       * Terminate the current line by writing the line separator string.  The
       * line separator string is defined by the system property
       * <code>line.separator</code>, and is not necessarily a single newline
       * character (<code>'\n'</code>).
       * @throws           java.io.IOException
       */
  
      abstract public void println() throws IOException;
  
      /**
       * Print a boolean value and then terminate the line.  This method behaves
       * as though it invokes <code>{@link #print(boolean)}</code> and then
       * <code>{@link #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(boolean x) throws IOException;
  
      /**
       * Print a character and then terminate the line.  This method behaves as
       * though it invokes <code>{@link #print(char)}</code> and then <code>{@link
       * #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(char x) throws IOException;
  
      /**
       * Print an integer and then terminate the line.  This method behaves as
       * though it invokes <code>{@link #print(int)}</code> and then <code>{@link
       * #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(int x) throws IOException;
  
      /**
       * Print a long integer and then terminate the line.  This method behaves
       * as though it invokes <code>{@link #print(long)}</code> and then
       * <code>{@link #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(long x) throws IOException;
  
      /**
       * Print a floating-point number and then terminate the line.  This method
       * behaves as though it invokes <code>{@link #print(float)}</code> and then
       * <code>{@link #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(float x) throws IOException;
  
      /**
       * Print a double-precision floating-point number and then terminate the
       * line.  This method behaves as though it invokes <code>{@link
       * #print(double)}</code> and then <code>{@link #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(double x) throws IOException;
  
      /**
       * Print an array of characters and then terminate the line.  This method
       * behaves as though it invokes <code>print(char[])</code> and then
       * <code>println()</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(char x[]) throws IOException;
  
      /**
       * Print a String and then terminate the line.  This method behaves as
       * though it invokes <code>{@link #print(String)}</code> and then
       * <code>{@link #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(String x) throws IOException;
  
      /**
       * Print an Object and then terminate the line.  This method behaves as
       * though it invokes <code>{@link #print(Object)}</code> and then
       * <code>{@link #println()}</code>.
       * @throws           java.io.IOException
       */
  
      abstract public void println(Object x) throws IOException;
  
  
      /**
       * Clear the contents of the buffer. If the buffer has been already
       * been flushed then the clear operation shall throw an IOException
       * to signal the fact that some data has already been irrevocably 
       * written to the client response stream.
       *
       * @throws IOException            If an I/O error occurs
       */
  
      abstract public void clear() throws IOException;
  
      /**
       * Clears the current contents of the buffer. Unlike clear(), this
       * method will not throw an IOException if the buffer has already been
       * flushed. It merely clears the current content of the buffer and
       * returns.
      *
       * @throws IOException            If an I/O error occurs
       */
  
      abstract public void clearBuffer() throws IOException;
  
      /**
       * Flush the stream.  If the stream has saved any characters from the
       * various write() methods in a buffer, write them immediately to their
       * intended destination.  Then, if that destination is another character or
       * byte stream, flush it.  Thus one flush() invocation will flush all the
       * buffers in a chain of Writers and OutputStreams.
       * <p>
       * The method may be invoked indirectly if the buffer size is exceeded.
       * <p>
       * Once a stream has been closed,
       * further write() or flush() invocations will cause an IOException to be
       * thrown.
       *
       * @exception  IOException  If an I/O error occurs
       */
  
      abstract public void flush() throws IOException;
  
      /**
       * Close the stream, flushing it first
       * <p>
       * This method needs not be invoked explicitly for the initial JspWriter
       * as the code generated by the JSP container will automatically
       * include a call to close().
       * <p>
       * Closing a previously-closed stream, unlike flush(), has no effect.
       *
       * @exception  IOException  If an I/O error occurs
       */
  
      abstract public void close() throws IOException;
  
      /**
       * This method returns the size of the buffer used by the JspWriter.
       *
       * @return the size of the buffer in bytes, or 0 is unbuffered.
       */
  
      public int getBufferSize() { return bufferSize; }
  
      /**
       * This method returns the number of unused bytes in the buffer.
       *
       * @return the number of bytes unused in the buffer
       */
  
      abstract public int getRemaining();
  
      /**
       * This method indicates whether the JspWriter is autoFlushing.
       *
       * @return if this JspWriter is auto flushing or throwing IOExceptions on buffer 
overflow conditions
       */
  
      public boolean isAutoFlush() { return autoFlush; }
  
      /*
       * fields
       */
  
      protected int     bufferSize;
      protected boolean autoFlush;
  }
  
  
  
  1.1                  contrib/jetty/src/main/javax/servlet/jsp/PageContext.java
  
  Index: PageContext.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 javax.servlet.jsp;
  
  import java.io.IOException;
  
  import java.util.Enumeration;
  
  import javax.servlet.Servlet;
  import javax.servlet.ServletConfig;
  import javax.servlet.ServletContext;
  import javax.servlet.ServletException;
  import javax.servlet.ServletRequest;
  import javax.servlet.ServletResponse;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpSession;
  
  import javax.servlet.jsp.tagext.BodyContent;
  
  /**
   * <p>
   * A PageContext instance provides access to all the namespaces associated
   * with a JSP page, provides access to several page attributes, as well as
   * a layer above the implementation details.  Implicit objects are added
   * the pageContext automatically.
   *
   * <p> The <code> PageContext </code> class is an abstract class, designed to be
   * extended to provide implementation dependent implementations thereof, by
   * conformant JSP engine runtime environments. A PageContext instance is 
   * obtained by a JSP implementation class by calling the
   * JspFactory.getPageContext() method, and is released by calling
   * JspFactory.releasePageContext().
   *
   * <p> An example of how PageContext, JspFactory, and other classes can be
   * used  within a JSP Page Implementation object is given elsewhere.
   *
   * <p>
   * The PageContext provides a number of facilities to the page/component author and
   * page implementor, including:
   * <ul>
   * <li>a single API to manage the various scoped namespaces
   * <li>a number of convenience API's to access various public objects
   * <li>a mechanism to obtain the JspWriter for output
   * <li>a mechanism to manage session usage by the page
   * <li>a mechanism to expose page directive attributes to the scripting environment
   * <li>mechanisms to forward or include the current request to other active 
components in the application
   * <li>a mechanism to handle errorpage exception processing
   * </ul>
   *
   * <p><B>Methods Intended for Container Generated Code</B>
   * <p>Some methods are intended to be used by the code generated by the
   * container, not by code written by JSP page authors, or JSP tag library authors.
   * <p>The methods supporting <B>lifecycle</B> are <code>initialize()</code>
   * and <code>release()</code>
   *
   * <p>
   * The following methods enable the <B>management of nested</B> JspWriter streams to
   * implement Tag Extensions: <code>pushBody()</code> and <code>popBody()</code>
   *
   * <p><B>Methods Intended for JSP authors</B>
   * <p>
   * Some methods provide <B>uniform access</B> to the diverse objects
   * representing scopes.
   * The implementation must use the underlying Servlet machinery
   * corresponding to that scope, so information can be passed back and
   * forth between Servlets and JSP pages.  The methods are:
   * <code>setAttribute()</code>,  <code>getAttribute()</code>,
   * <code>findAttribute()</code>,  <code>removeAttribute()</code>,
   * <code>getAttributesScope()</code> and  <code>getAttributeNamesInScope()</code> .
   * 
   * <p>
   * The following methods provide <B>convenient access</B> to implicit objects:
   * <ul>
   * <code>getOut()</code>,  <code>getException()</code>,  <code>getPage()</code>
   * <code>getRequest()</code>,  <code>getResponse()</code>,
   * <code>getSession()</code>,  <code>getServletConfig()</code>
   * and <code>getServletContext()</code>.
   *
   * <p>
   * The following methods provide support for <B>forwarding, inclusion
   * and error handling</B>:
   * <code>forward()</code>,  <code>include()</code>,
   * and  <code>handlePageException()</code>.
   */
  
  abstract public class PageContext {
  
      /**
       * Page scope: (this is the default) the named reference remains available
       * in this PageContext until the return from the current Servlet.service()
       * invocation.
       */
  
      public static final int PAGE_SCOPE                = 1;
  
      /**
       * Request scope: the named reference remains available from the ServletRequest
       * associated with the Servlet until the current request is completed.
       */
  
      public static final int REQUEST_SCOPE     = 2;
  
      /**
       * Session scope (only valid if this page participates in a session):
       * the named reference remains available from the HttpSession (if any)
       * associated with the Servlet until the HttpSession is invalidated.
       */
  
      public static final int SESSION_SCOPE     = 3;
  
      /**
       * Application scope: named reference remains available in the 
       * ServletContext until it is reclaimed.
       */
  
      public static final int APPLICATION_SCOPE = 4;
  
      /**
       * Name used to store the Servlet in this PageContext's nametables.
       */
  
      public static final String        PAGE            = "javax.servlet.jsp.jspPage";
  
      /**
       * Name used to store this PageContext in it's own name table.
       */
  
      public static final String        PAGECONTEXT     = 
"javax.servlet.jsp.jspPageContext";
  
      /**
       * Name used to store ServletRequest in PageContext name table.
       */
  
      public static final String        REQUEST         = 
"javax.servlet.jsp.jspRequest";
  
      /**
       * Name used to store ServletResponse in PageContext name table.
       */
  
      public static final String        RESPONSE        = 
"javax.servlet.jsp.jspResponse";
  
      /**
       * Name used to store ServletConfig in PageContext name table.
       */
  
      public static final String        CONFIG          = 
"javax.servlet.jsp.jspConfig";
  
      /**
       * Name used to store HttpSession in PageContext name table.
       */
  
      public static final String        SESSION         = 
"javax.servlet.jsp.jspSession";
      /**
       * Name used to store current JspWriter in PageContext name table.
       */
  
      public static final String        OUT             = "javax.servlet.jsp.jspOut";
  
      /**
       * Name used to store ServletContext in PageContext name table.
       */
  
      public static final String        APPLICATION     = 
"javax.servlet.jsp.jspApplication";
  
      /**
       * Name used to store uncaught exception in ServletRequest attribute list and 
PageContext name table.
       */
  
      public static final String        EXCEPTION       = 
"javax.servlet.jsp.jspException";
  
      /**
       * <p>
       * The initialize method is called to initialize an uninitialized PageContext
       * so that it may be used by a JSP Implementation class to service an
       * incoming request and response within it's _jspService() method.
       *
       * <p>
       * This method is typically called from JspFactory.getPageContext() in
       * order to initialize state.
       *
       * <p>
       * This method is required to create an initial JspWriter, and associate
       * the "out" name in page scope with this newly created object.
       *
       * <p>
       * This method should not be used by page  or tag library authors.
       *
       * @param servlet The Servlet that is associated with this PageContext
       * @param request The currently pending request for this Servlet
       * @param response The currently pending response for this Servlet
       * @param errorPageURL The value of the errorpage attribute from the page 
directive or null
       * @param needsSession The value of the session attribute from the page directive
       * @param bufferSize The value of the buffer attribute from the page directive
       * @param autoFlush The value of the autoflush attribute from the page directive
       *
       * @throws IOException during creation of JspWriter
       * @throws IllegalStateException if out not correctly initialized
       */
   
      abstract public void initialize(Servlet servlet, ServletRequest request, 
ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, 
boolean autoFlush)  throws IOException, IllegalStateException, 
IllegalArgumentException;
  
      /**
       * <p>
       * This method shall "reset" the internal state of a PageContext, releasing
       * all internal references, and preparing the PageContext for potential
       * reuse by a later invocation of initialize(). This method is typically
       * called from JspFactory.releasePageContext().
       *
       * <p>
       * Subclasses shall envelope this method.
       *
       * <p>
       * This method should not be used by page  or tag library authors.
       *
       */
  
      abstract public void release();
  
  
      /**
       * Register the name and object specified with page scope semantics.
       *
       * @param name the name of the attribute to set
       * @param attribute  the object to associate with the name
       * 
       * @throws NullPointerException if the name or object is null
       */
  
      abstract public void setAttribute(String name, Object attribute);
  
      /**
       * register the name and object specified with appropriate scope semantics
       * 
       * @param name the name of the attribute to set
       * @param o    the object to associate with the name
       * @param scope the scope with which to associate the name/object
       * 
       * @throws NullPointerException if the name or object is null
       * @throws IllegalArgumentException if the scope is invalid
       *
       */
  
      abstract public void setAttribute(String name, Object o, int scope);
  
      /**
       * Return the object associated with the name in the page scope or null
       * if not found.
       *
       * @param name the name of the attribute to get
       * 
       * @throws NullPointerException if the name is null
       * @throws IllegalArgumentException if the scope is invalid
       */
  
      abstract public Object getAttribute(String name);
  
      /**
       * Return the object associated with the name in the specified
       * scope or null if not found.
       *
       * @param name the name of the attribute to set
       * @param scope the scope with which to associate the name/object
       * 
       * @throws NullPointerException if the name is null
       * @throws IllegalArgumentException if the scope is invalid */
  
      abstract public Object getAttribute(String name, int scope);
  
      /**
       * Searches for the named attribute in page, request, session (if valid),
       * and application scope(s) in order and returns the value associated or
       * null.
       *
       * @return the value associated or null
       */
  
      abstract public Object findAttribute(String name);
  
      /**
       * Remove the object reference associated with the given name,
       * look in all scopes in the scope order.
       *
       * @param name The name of the object to remove.
       */
  
      abstract public void removeAttribute(String name);
  
      /**
       * Remove the object reference associated with the specified name
       * in the given scope.
       *
       * @param name The name of the object to remove.
       * @param scope The scope where to look.
       */
  
      abstract public void removeAttribute(String name, int scope);
  
      /**
       * Get the scope where a given attribute is defined.
       *
       * @return the scope of the object associated with the name specified or 0
       */
  
      abstract public int getAttributesScope(String name);
  
      /**
       * Enumerate all the attributes in a given scope
       *
       * @return an enumeration of names (java.lang.String) of all the attributes the 
specified scope
       */
  
  
      abstract public Enumeration getAttributeNamesInScope(int scope);
  
      /**
       * The current value of the out object (a JspWriter).
       *
       * @return the current JspWriter stream being used for client response
       */
  
      abstract public JspWriter getOut();
  
      /**
       * The current value of the session object (an HttpSession).
       *
       * @return the HttpSession for this PageContext or null
       */
  
      abstract public HttpSession getSession();
  
      /**
       * The current value of the page object (a Servlet).
       *
       * @return the Page implementation class instance (Servlet)  associated with 
this PageContext
       */
  
      abstract public Object getPage();
  
  
      /**
       * The current value of the request object (a ServletRequest).
       *
       * @return The ServletRequest for this PageContext
       */
  
      abstract public ServletRequest getRequest();
  
      /**
       * The current value of the response object (a ServletResponse).
       *
       * @return the ServletResponse for this PageContext
       */
  
      abstract public ServletResponse getResponse();
  
      /**
       * The current value of the exception object (an Exception).
       *
       * @return any exception passed to this as an errorpage
       */
  
      abstract public Exception getException();
  
      /**
       * The ServletConfig instance.
       *
       * @return the ServletConfig for this PageContext
       */
  
      abstract public ServletConfig getServletConfig();
  
      /**
       * The ServletContext instance.
       * 
       * @return the ServletContext for this PageContext
       */
  
      abstract public ServletContext getServletContext();
  
      /**
       * <p>
       * This method is used to re-direct, or "forward" the current ServletRequest and 
ServletResponse to another active component in the application.
       * </p>
       * <p>
       * If the <I> relativeUrlPath </I> begins with a "/" then the URL specified
       * is calculated relative to the DOCROOT of the <code> ServletContext </code>
       * for this JSP. If the path does not begin with a "/" then the URL 
       * specified is calculated relative to the URL of the request that was
       * mapped to the calling JSP.
       * </p>
       * <p>
       * It is only valid to call this method from a <code> Thread </code>
       * executing within a <code> _jspService(...) </code> method of a JSP.
       * </p>
       * <p>
       * Once this method has been called successfully, it is illegal for the
       * calling <code> Thread </code> to attempt to modify the <code>
       * ServletResponse </code> object.  Any such attempt to do so, shall result
       * in undefined behavior. Typically, callers immediately return from 
       * <code> _jspService(...) </code> after calling this method.
       * </p>
       *
       * @param relativeUrlPath specifies the relative URL path to the target resource 
as described above
       *
       * @throws ServletException
       * @throws IOException
       *
       * @throws IllegalArgumentException if target resource URL is unresolvable
       * @throws IllegalStateException if <code> ServletResponse </code> is not in a 
state where a forward can be performed
       * @throws SecurityException if target resource cannot be accessed by caller
       */
  
      abstract public void forward(String relativeUrlPath) throws ServletException, 
IOException;
  
      /**
       * <p>
       * Causes the resource specified to be processed as part of the current
       * ServletRequest and ServletResponse being processed by the calling Thread.
       * The output of the target resources processing of the request is written
       * directly to the ServletResponse output stream.
       * </p>
       * <p>
       * The current JspWriter "out" for this JSP is flushed as a side-effect
       * of this call, prior to processing the include.
       * </p>
       * <p>
       * If the <I> relativeUrlPath </I> begins with a "/" then the URL specified
       * is calculated relative to the DOCROOT of the <code> ServletContext </code>
       * for this JSP. If the path does not begin with a "/" then the URL 
       * specified is calculated relative to the URL of the request that was
       * mapped to the calling JSP.
       * </p>
       * <p>
       * It is only valid to call this method from a <code> Thread </code>
       * executing within a <code> _jspService(...) </code> method of a JSP.
       * </p>
       *
       * @param relativeUrlPath specifies the relative URL path to the target resource 
to be included
       *
       * @throws ServletException
       * @throws IOException
       *
       * @throws IllegalArgumentException if the target resource URL is unresolvable
       * @throws SecurityException if target resource cannot be accessed by caller
       *
       */
  
      abstract public void include(String relativeUrlPath) throws ServletException, 
IOException;
  
      /**
       * <p>
       * This method is intended to process an unhandled "page" level exception
       * by redirecting the exception to either the specified error page for this
       * JSP, or if none was specified, to perform some implementation dependent
       * action.
       *
       * <p>
       * A JSP implementation class shall typically clean up any local state
       * prior to invoking this and will return immediately thereafter. It is
       * illegal to generate any output to the client, or to modify any 
       * ServletResponse state after invoking this call.
       *
       * <p>
       * This method is kept for backwards compatiblity reasons.  Newly
       * generated code should use PageContext.handlePageException(Throwable).
       *
       * @param e the exception to be handled
       *
       * @throws ServletException
       * @throws IOException
       *
       * @throws NullPointerException if the exception is null
       * @throws SecurityException if target resource cannot be accessed by caller
       *
       * @see #handlePageException(Throwable)
       */
  
      abstract public void handlePageException(Exception e) throws ServletException, 
IOException;
  
      /**
       * <p>
       * This method is identical to the handlePageException(Exception),
       * except that it accepts a Throwable.  This is the preferred method
       * to use as it allows proper implementation of the errorpage
       * semantics.
       *
       * <p>
       * This method is intended to process an unhandled "page" level exception
       * by redirecting the exception to either the specified error page for this
       * JSP, or if none was specified, to perform some implementation dependent
       * action.
       *
       * <p>
       * A JSP implementation class shall typically clean up any local state
       * prior to invoking this and will return immediately thereafter. It is
       * illegal to generate any output to the client, or to modify any 
       * ServletResponse state after invoking this call.
       *
       * @param t the throwable to be handled
       *
       * @throws ServletException
       * @throws IOException
       *
       * @throws NullPointerException if the exception is null
       * @throws SecurityException if target resource cannot be accessed by caller
       *
       * @see #handlePageException(Exception)
       */
  
      abstract public void handlePageException(Throwable t) throws ServletException, 
IOException;
  
      /**
       * Return a new BodyContent object, save the current "out" JspWriter,
       * and update the value of the "out" attribute in the page scope
       * attribute namespace of the PageContext
       *
       * @return the new BodyContent
       */
  
      public BodyContent pushBody() {
          return null; // XXX to implement
      }
           
  
      /**
       * Return the previous JspWriter "out" saved by the matching
       * pushBody(), and update the value of the "out" attribute in
       * the page scope attribute namespace of the PageConxtext
       *
       * @return the saved JspWriter.
       */
  
      public JspWriter popBody() {
          return null; // XXX to implement
      }
      
  }
  
  
  

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

Reply via email to