tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r379499 [3/5] - in /tomcat/jasper/tc6.0.x/src: etc/ etc/dtd/ share/javax/servlet/ share/javax/servlet/jsp/ share/javax/servlet/jsp/el/ share/javax/servlet/jsp/tagext/ share/javax/servlet/jsp/tagext/doc-files/ share/org/apache/jasper/runtime/
Date Tue, 21 Feb 2006 15:46:40 GMT
Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/PageContext.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/PageContext.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/PageContext.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/PageContext.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,522 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+package javax.servlet.jsp;
+
+import java.io.IOException;
+
+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.HttpSession;
+
+import javax.servlet.jsp.tagext.BodyContent;
+
+/**
+ * <p>
+ * PageContext extends JspContext to provide useful context information for
+ * when JSP technology is used in a Servlet environment.
+ * <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
+ * to 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>
+ *
+ * <p><B>Methods Intended for JSP authors</B>
+ * <p>
+ * The following methods provide <B>convenient access</B> to implicit objects:
+ * <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 
+    extends JspContext
+{
+    
+    /**
+     * Sole constructor. (For invocation by subclass constructors, 
+     * typically implicit.)
+     */
+    public 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
+     * @throws IllegalArgumentException If one of the given parameters
+     *     is invalid
+     */
+ 
+    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();
+
+    /**
+     * 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 (In a Servlet environment, 
+     * this is an instance of javax.servlet.Servlet).
+     *
+     * @return the Page implementation class instance 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 IllegalStateException if <code> ServletResponse </code> is not 
+     *     in a state where a forward can be performed
+     * @throws ServletException if the page that was forwarded to throws
+     *     a ServletException
+     * @throws IOException if an I/O error occurred while forwarding
+     */
+
+    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 if the page that was forwarded to throws
+     *     a ServletException
+     * @throws IOException if an I/O error occurred while forwarding
+     */
+    abstract public void include(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 current JspWriter returned by a call to getOut().
+     * </p>
+     * <p>
+     * If flush is true, The current JspWriter "out" for this JSP 
+     * is flushed as a side-effect of this call, prior to processing 
+     * the include.  Otherwise, the JspWriter "out" is not flushed.
+     * </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
+     * @param flush True if the JspWriter is to be flushed before the include,
+     *     or false if not.
+     *
+     * @throws ServletException if the page that was forwarded to throws
+     *     a ServletException
+     * @throws IOException if an I/O error occurred while forwarding
+     * @since 2.0
+     */
+    abstract public void include(String relativeUrlPath, boolean flush) 
+	throws ServletException, IOException;
+
+    /**
+     * <p>
+     * This method is intended to process an unhandled 'page' level
+     * exception by forwarding the exception to the specified
+     * error page for this JSP.  If forwarding is not possible (for
+     * example because the response has already been committed), an
+     * implementation dependent mechanism should be used to invoke
+     * the error page (e.g. "including" the error page instead).
+     *
+     * <p>
+     * If no error page is defined in the page, the exception should
+     * be rethrown so that the standard servlet error handling
+     * takes over.
+     *
+     * <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 if an error occurs while invoking the error page
+     * @throws IOException if an I/O error occurred while invoking the error
+     *     page
+     * @throws NullPointerException if the exception is null
+     *
+     * @see #handlePageException(Throwable)
+     */
+
+    abstract public void handlePageException(Exception e) 
+        throws ServletException, IOException;
+
+    /**
+     * <p>
+     * This method is intended to process an unhandled 'page' level
+     * exception by forwarding the exception to the specified
+     * error page for this JSP.  If forwarding is not possible (for
+     * example because the response has already been committed), an
+     * implementation dependent mechanism should be used to invoke
+     * the error page (e.g. "including" the error page instead).
+     *
+     * <p>
+     * If no error page is defined in the page, the exception should
+     * be rethrown so that the standard servlet error handling
+     * takes over.
+     *
+     * <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 if an error occurs while invoking the error page
+     * @throws IOException if an I/O error occurred while invoking the error
+     *     page
+     * @throws NullPointerException if the exception is null
+     *
+     * @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
+    }
+         
+
+    /**
+     * Provides convenient access to error information.
+     *
+     * @return an ErrorData instance containing information about the 
+     * error, as obtained from the request attributes, as per the 
+     * Servlet specification.  If this is not an error page (that is,
+     * if the isErrorPage attribute of the page directive is not set
+     * to "true"), the information is meaningless.
+     *
+     * @since 2.0
+     */
+    public ErrorData getErrorData() {
+	return new ErrorData( 
+	    (Throwable)getRequest().getAttribute( "javax.servlet.error.exception" ),
+	    ((Integer)getRequest().getAttribute( 
+		"javax.servlet.error.status_code" )).intValue(),
+	    (String)getRequest().getAttribute( "javax.servlet.error.request_uri" ),
+	    (String)getRequest().getAttribute( "javax.servlet.error.servlet_name" ) );
+    }
+    
+}

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/SkipPageException.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/SkipPageException.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/SkipPageException.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/SkipPageException.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,75 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.servlet.jsp;
+
+/**
+ * Exception to indicate the calling page must cease evaluation.
+ * Thrown by a simple tag handler to indicate that the remainder of 
+ * the page must not be evaluated.  The result is propagated back to
+ * the pagein the case where one tag invokes another (as can be
+ * the case with tag files).  The effect is similar to that of a 
+ * Classic Tag Handler returning Tag.SKIP_PAGE from doEndTag().
+ * Jsp Fragments may also throw this exception.  This exception
+ * should not be thrown manually in a JSP page or tag file - the behavior is
+ * undefined.  The exception is intended to be thrown inside 
+ * SimpleTag handlers and in JSP fragments.
+ * 
+ * @see javax.servlet.jsp.tagext.SimpleTag#doTag
+ * @see javax.servlet.jsp.tagext.JspFragment#invoke
+ * @see javax.servlet.jsp.tagext.Tag#doEndTag
+ * @since 2.0
+ */
+public class SkipPageException
+    extends JspException
+{
+    /**
+     * Creates a SkipPageException with no message.
+     */
+    public SkipPageException() {
+        super();
+    }
+    
+    /**
+     * Creates a SkipPageException with the provided message.
+     *
+     * @param message the detail message
+     */
+    public SkipPageException( String message ) {
+        super( message );
+    }
+
+    /**
+     * Creates a SkipPageException with the provided message and root cause.
+     *
+     * @param message the detail message
+     * @param rootCause the originating cause of this exception
+     */
+    public SkipPageException( String message, Throwable rootCause ) {
+	super( message, rootCause );
+    }
+
+    /**
+     * Creates a SkipPageException with the provided root cause.
+     *
+     * @param rootCause the originating cause of this exception
+     */
+    public SkipPageException( Throwable rootCause ) {
+	super( rootCause );
+    }
+    
+}
+
+

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELException.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELException.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELException.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELException.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,92 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package javax.servlet.jsp.el;
+
+
+/**
+ * Represents any of the exception conditions that arise during the
+ * operation evaluation of the evaluator.
+ *
+ * @since 2.0
+ * @deprecated
+ */
+public class ELException
+  extends Exception
+{
+  //-------------------------------------
+  // Member variables
+  //-------------------------------------
+
+  private Throwable mRootCause;
+
+  //-------------------------------------
+  /**
+   * Creates an ELException with no detail message.
+   **/
+  public ELException ()
+  {
+    super ();
+  }
+
+  //-------------------------------------
+  /**
+   * Creates an ELException with the provided detail message.
+   *
+   * @param pMessage the detail message
+   **/
+  public ELException (String pMessage)
+  {
+    super (pMessage);
+  }
+
+  //-------------------------------------
+  /**
+   * Creates an ELException with the given root cause.
+   *
+   * @param pRootCause the originating cause of this exception
+   **/
+  public ELException (Throwable pRootCause)
+  {
+    super( pRootCause.getLocalizedMessage() );
+    mRootCause = pRootCause;
+  }
+
+  //-------------------------------------
+  /**
+   * Creates an ELException with the given detail message and root cause.
+   *
+   * @param pMessage the detail message
+   * @param pRootCause the originating cause of this exception
+   **/
+  public ELException (String pMessage,
+		      Throwable pRootCause)
+  {
+    super (pMessage);
+    mRootCause = pRootCause;
+  }
+
+  //-------------------------------------
+  /**
+   * Returns the root cause.
+   *
+   * @return the root cause of this exception
+   */
+  public Throwable getRootCause ()
+  {
+    return mRootCause;
+  }
+}

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELParseException.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELParseException.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELParseException.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ELParseException.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,50 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package javax.servlet.jsp.el;
+
+
+/**
+ * Represents a parsing error encountered while parsing an EL expression.
+ *
+ * @since 2.0
+ * @deprecated
+ */
+
+public class ELParseException extends ELException {
+
+ //-------------------------------------
+  /**
+   * Creates an ELParseException with no detail message.
+   */
+  public ELParseException ()
+  {
+    super ();
+  }
+
+  //-------------------------------------
+  /**
+   * Creates an ELParseException with the provided detail message.
+   *
+   * @param pMessage the detail message
+   **/
+  public ELParseException (String pMessage)
+  {
+    super (pMessage);
+  }
+
+  //-------------------------------------
+}

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/Expression.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/Expression.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/Expression.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/Expression.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,52 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package javax.servlet.jsp.el;
+
+
+/**
+ * <p>The abstract class for a prepared expression.</p>
+ *
+ * <p>An instance of an Expression can be obtained via from an 
+ * ExpressionEvaluator instance.</p>
+ *
+ * <p>An Expression may or not have done a syntactic parse of the expression.
+ * A client invoking the evaluate() method should be ready for the case 
+ * where ELParseException exceptions are raised. </p>
+ *
+ * @since 2.0
+ * @deprecated
+ */
+public abstract class Expression {
+
+    /** 
+     * Evaluates an expression that was previously prepared.  In some 
+     * implementations preparing an expression involves full syntactic 
+     * validation, but others may not do so.  Evaluating the expression may 
+     * raise an ELParseException as well as other ELExceptions due to 
+     * run-time evaluation.
+     *
+     * @param vResolver A VariableResolver instance that can be used at 
+     *   runtime to resolve the name of implicit objects into Objects.
+     * @return The result of the expression evaluation.
+     *
+     * @exception ELException Thrown if the expression evaluation failed.
+     */ 
+    public abstract Object evaluate( VariableResolver vResolver )
+        throws ELException;
+}
+

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ExpressionEvaluator.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ExpressionEvaluator.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ExpressionEvaluator.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ExpressionEvaluator.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,107 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package javax.servlet.jsp.el;
+
+
+/**
+ * <p>The abstract base class for an expression-language evaluator.
+ * Classes that implement an expression language expose their functionality
+ * via this abstract class.</p>
+ *
+ * <p>An instance of the ExpressionEvaluator can be obtained via the 
+ * JspContext / PageContext</p>
+ *
+ * <p>The parseExpression() and evaluate() methods must be thread-safe.  
+ * That is, multiple threads may call these methods on the same 
+ * ExpressionEvaluator object simultaneously.  Implementations should 
+ * synchronize access if they depend on transient state.  Implementations 
+ * should not, however, assume that only one object of each 
+ * ExpressionEvaluator type will be instantiated; global caching should 
+ * therefore be static.</p>
+ *
+ * <p>Only a single EL expression, starting with '${' and ending with
+ * '}', can be parsed or evaluated at a time.  EL expressions 
+ * cannot be mixed with static text.  For example, attempting to 
+ * parse or evaluate "<code>abc${1+1}def${1+1}ghi</code>" or even
+ * "<code>${1+1}${1+1}</code>" will cause an <code>ELException</code> to
+ * be thrown.</p>
+ *
+ * <p>The following are examples of syntactically legal EL expressions:
+ *
+ * <ul>
+ *   <li><code>${person.lastName}</code></li>
+ *   <li><code>${8 * 8}</code></li>
+ *   <li><code>${my:reverse('hello')}</code></li>
+ * </ul>
+ * </p>
+ *
+ * @since 2.0
+ * @deprecated
+ */
+public abstract class ExpressionEvaluator {
+
+    /**
+     * Prepare an expression for later evaluation.  This method should perform
+     * syntactic validation of the expression; if in doing so it detects 
+     * errors, it should raise an ELParseException.
+     *
+     * @param expression The expression to be evaluated.
+     * @param expectedType The expected type of the result of the evaluation
+     * @param fMapper A FunctionMapper to resolve functions found in 
+     *     the expression.  It can be null, in which case no functions 
+     *     are supported for this invocation.  The ExpressionEvaluator 
+     *     must not hold on to the FunctionMapper reference after 
+     *     returning from <code>parseExpression()</code>.  The 
+     *     <code>Expression</code> object returned must invoke the same 
+     *     functions regardless of whether the mappings in the 
+     *     provided <code>FunctionMapper</code> instance change between 
+     *     calling <code>ExpressionEvaluator.parseExpression()</code>
+     *     and <code>Expression.evaluate()</code>.
+     * @return The Expression object encapsulating the arguments.
+     *
+     * @exception ELException Thrown if parsing errors were found.
+     */ 
+    public abstract Expression parseExpression( String expression, 
+				       Class expectedType, 
+				       FunctionMapper fMapper ) 
+      throws ELException; 
+
+
+    /** 
+     * Evaluates an expression.  This method may perform some syntactic 
+     * validation and, if so, it should raise an ELParseException error if 
+     * it encounters syntactic errors.  EL evaluation errors should cause 
+     * an ELException to be raised.
+     *
+     * @param expression The expression to be evaluated.
+     * @param expectedType The expected type of the result of the evaluation
+     * @param vResolver A VariableResolver instance that can be used at 
+     *     runtime to resolve the name of implicit objects into Objects.
+     * @param fMapper A FunctionMapper to resolve functions found in 
+     *     the expression.  It can be null, in which case no functions 
+     *     are supported for this invocation.  
+     * @return The result of the expression evaluation.
+     *
+     * @exception ELException Thrown if the expression evaluation failed.
+     */ 
+    public abstract Object evaluate( String expression, 
+			    Class expectedType, 
+			    VariableResolver vResolver,
+			    FunctionMapper fMapper ) 
+      throws ELException; 
+}
+

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/FunctionMapper.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/FunctionMapper.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/FunctionMapper.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/FunctionMapper.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,39 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package javax.servlet.jsp.el;
+
+/**
+ * <p>The interface to a map between EL function names and methods.</p>
+ *
+ * <p>Classes implementing this interface may, for instance, consult tag library
+ * information to resolve the map. </p>
+ *
+ * @since 2.0
+ * @deprecated
+ */
+public interface FunctionMapper {
+  /**
+   * Resolves the specified local name and prefix into a Java.lang.Method.
+   * Returns null if the prefix and local name are not found.
+   * 
+   * @param prefix the prefix of the function, or "" if no prefix.
+   * @param localName the short name of the function
+   * @return the result of the method mapping.  Null means no entry found.
+   **/
+  public java.lang.reflect.Method resolveFunction(String prefix, 
+      String localName);
+}

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ImplicitObjectELResolver.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ImplicitObjectELResolver.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ImplicitObjectELResolver.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ImplicitObjectELResolver.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,538 @@
+package javax.servlet.jsp.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.servlet.jsp.JspContext;
+import javax.servlet.jsp.PageContext;
+
+/**
+ *
+ * @since 2.1
+ */
+public class ImplicitObjectELResolver extends ELResolver {
+
+    private final static String[] SCOPE_NAMES = new String[] {
+            "applicationScope", "cookie", "header", "headerValues",
+            "initParam", "pageContext", "pageScope", "param", "paramValues",
+            "requestScope", "sessionScope" };
+
+    private final static int APPLICATIONSCOPE = 0;
+
+    private final static int COOKIE = 1;
+
+    private final static int HEADER = 2;
+
+    private final static int HEADERVALUES = 3;
+
+    private final static int INITPARAM = 4;
+
+    private final static int PAGECONTEXT = 5;
+
+    private final static int PAGESCOPE = 6;
+
+    private final static int PARAM = 7;
+
+    private final static int PARAM_VALUES = 8;
+
+    private final static int REQUEST_SCOPE = 9;
+
+    private final static int SESSION_SCOPE = 10;
+
+    public ImplicitObjectELResolver() {
+        super();
+    }
+
+    public Object getValue(ELContext context, Object base, Object property)
+            throws NullPointerException, PropertyNotFoundException, ELException {
+        if (context == null) {
+            throw new NullPointerException();
+        }
+
+        if (base == null && property != null) {
+            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
+
+            if (idx >= 0) {
+                PageContext page = (PageContext) context
+                        .getContext(JspContext.class);
+                context.setPropertyResolved(true);
+                switch (idx) {
+                case APPLICATIONSCOPE:
+                    return ScopeManager.get(page).getApplicationScope();
+                case COOKIE:
+                    return ScopeManager.get(page).getCookie();
+                case HEADER:
+                    return ScopeManager.get(page).getHeader();
+                case HEADERVALUES:
+                    return ScopeManager.get(page).getHeaderValues();
+                case INITPARAM:
+                    return ScopeManager.get(page).getInitParam();
+                case PAGECONTEXT:
+                    return ScopeManager.get(page).getPageContext();
+                case PAGESCOPE:
+                    return ScopeManager.get(page).getPageScope();
+                case PARAM:
+                    return ScopeManager.get(page).getParam();
+                case PARAM_VALUES:
+                    return ScopeManager.get(page).getParamValues();
+                case REQUEST_SCOPE:
+                    return ScopeManager.get(page).getRequestScope();
+                case SESSION_SCOPE:
+                    return ScopeManager.get(page).getSessionScope();
+                }
+            }
+        }
+        return null;
+    }
+
+    public Class<?> getType(ELContext context, Object base, Object property)
+            throws NullPointerException, PropertyNotFoundException, ELException {
+        if (context == null) {
+            throw new NullPointerException();
+        }
+
+        if (base == null && property != null) {
+            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
+            if (idx >= 0) {
+                context.setPropertyResolved(true);
+            }
+        }
+        return null;
+    }
+
+    public void setValue(ELContext context, Object base, Object property,
+            Object value) throws NullPointerException,
+            PropertyNotFoundException, PropertyNotWritableException,
+            ELException {
+        if (context == null) {
+            throw new NullPointerException();
+        }
+
+        if (base == null && property != null) {
+            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
+            if (idx >= 0) {
+                context.setPropertyResolved(true);
+                throw new PropertyNotWritableException();
+            }
+        }
+    }
+
+    public boolean isReadOnly(ELContext context, Object base, Object property)
+            throws NullPointerException, PropertyNotFoundException, ELException {
+        if (context == null) {
+            throw new NullPointerException();
+        }
+
+        if (base == null && property != null) {
+            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
+            if (idx >= 0) {
+                context.setPropertyResolved(true);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public Iterator getFeatureDescriptors(ELContext context, Object base) {
+        List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(
+                SCOPE_NAMES.length);
+        FeatureDescriptor feat;
+        for (int i = 0; i < SCOPE_NAMES.length; i++) {
+            feat = new FeatureDescriptor();
+            feat.setDisplayName(SCOPE_NAMES[i]);
+            feat.setExpert(false);
+            feat.setHidden(false);
+            feat.setName(SCOPE_NAMES[i]);
+            feat.setPreferred(true);
+            feat.setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE);
+            feat.setValue(TYPE, String.class);
+            feats.add(feat);
+        }
+        return feats.iterator();
+    }
+
+    public Class<?> getCommonPropertyType(ELContext context, Object base) {
+        if (base == null) {
+            return String.class;
+        }
+        return null;
+    }
+
+    private static class ScopeManager {
+        private final static String MNGR_KEY = ScopeManager.class.getName();
+
+        private final PageContext page;
+
+        private Map applicationScope;
+
+        private Map cookie;
+
+        private Map header;
+
+        private Map headerValues;
+
+        private Map initParam;
+
+        private Map pageScope;
+
+        private Map param;
+
+        private Map paramValues;
+
+        private Map requestScope;
+
+        private Map sessionScope;
+
+        public ScopeManager(PageContext page) {
+            this.page = page;
+        }
+
+        public static ScopeManager get(PageContext page) {
+            ScopeManager mngr = (ScopeManager) page.getAttribute(MNGR_KEY);
+            if (mngr == null) {
+                mngr = new ScopeManager(page);
+                page.setAttribute(MNGR_KEY, mngr);
+            }
+            return mngr;
+        }
+
+        public Map getApplicationScope() {
+            if (this.applicationScope == null) {
+                this.applicationScope = new ScopeMap() {
+                    protected void setAttribute(String name, Object value) {
+                        page.getServletContext().setAttribute(name, value);
+                    }
+
+                    protected void removeAttribute(String name) {
+                        page.getServletContext().removeAttribute(name);
+                    }
+
+                    protected Enumeration getAttributeNames() {
+                        return page.getServletContext().getAttributeNames();
+                    }
+
+                    protected Object getAttribute(String name) {
+                        return page.getServletContext().getAttribute(name);
+                    }
+                };
+            }
+            return this.applicationScope;
+        }
+
+        public Map getCookie() {
+            if (this.cookie == null) {
+                this.cookie = new ScopeMap() {
+                    protected Enumeration getAttributeNames() {
+                        Cookie[] c = ((HttpServletRequest) page.getRequest())
+                                .getCookies();
+                        if (c != null) {
+                            Vector v = new Vector();
+                            for (int i = 0; i < c.length; i++) {
+                                v.add(c[i].getName());
+                            }
+                            return v.elements();
+                        }
+                        return null;
+                    }
+
+                    protected Object getAttribute(String name) {
+                        Cookie[] c = ((HttpServletRequest) page.getRequest())
+                                .getCookies();
+                        if (c != null) {
+                            for (int i = 0; i < c.length; i++) {
+                                if (name.equals(c[i].getName())) {
+                                    return c[i];
+                                }
+                            }
+                        }
+                        return null;
+                    }
+
+                };
+            }
+            return this.cookie;
+        }
+
+        public Map getHeader() {
+            if (this.header == null) {
+                this.header = new ScopeMap() {
+                    protected Enumeration getAttributeNames() {
+                        return ((HttpServletRequest) page.getRequest())
+                                .getHeaderNames();
+                    }
+
+                    protected Object getAttribute(String name) {
+                        return ((HttpServletRequest) page.getRequest())
+                                .getHeader(name);
+                    }
+                };
+            }
+            return this.header;
+        }
+
+        public Map getHeaderValues() {
+            if (this.headerValues == null) {
+                this.headerValues = new ScopeMap() {
+                    protected Enumeration getAttributeNames() {
+                        return ((HttpServletRequest) page.getRequest())
+                                .getHeaderNames();
+                    }
+
+                    protected Object getAttribute(String name) {
+                        Enumeration e = ((HttpServletRequest) page.getRequest())
+                                .getHeaders(name);
+                        if (e != null) {
+                            List list = new ArrayList();
+                            while (e.hasMoreElements()) {
+                                list.add(e.nextElement().toString());
+                            }
+                            return (String[]) list.toArray(new String[list
+                                    .size()]);
+                        }
+                        return null;
+                    }
+
+                };
+            }
+            return this.headerValues;
+        }
+
+        public Map getInitParam() {
+            if (this.initParam == null) {
+                this.initParam = new ScopeMap() {
+                    protected Enumeration getAttributeNames() {
+                        return page.getServletContext().getInitParameterNames();
+                    }
+
+                    protected Object getAttribute(String name) {
+                        return page.getServletContext().getInitParameter(name);
+                    }
+                };
+            }
+            return this.initParam;
+        }
+
+        public PageContext getPageContext() {
+            return this.page;
+        }
+
+        public Map getPageScope() {
+            if (this.pageScope == null) {
+                this.pageScope = new ScopeMap() {
+                    protected void setAttribute(String name, Object value) {
+                        page.setAttribute(name, value);
+                    }
+
+                    protected void removeAttribute(String name) {
+                        page.removeAttribute(name);
+                    }
+
+                    protected Enumeration getAttributeNames() {
+                        return page
+                                .getAttributeNamesInScope(PageContext.PAGE_SCOPE);
+                    }
+
+                    protected Object getAttribute(String name) {
+                        return page.getAttribute(name);
+                    }
+                };
+            }
+            return this.pageScope;
+        }
+
+        public Map getParam() {
+            if (this.param == null) {
+                this.param = new ScopeMap() {
+                    protected Enumeration getAttributeNames() {
+                        return page.getRequest().getParameterNames();
+                    }
+
+                    protected Object getAttribute(String name) {
+                        return page.getRequest().getParameter(name);
+                    }
+                };
+            }
+            return this.param;
+        }
+
+        public Map getParamValues() {
+            if (this.paramValues == null) {
+                this.paramValues = new ScopeMap() {
+                    protected Object getAttribute(String name) {
+                        return page.getRequest().getParameterValues(name);
+                    }
+
+                    protected Enumeration getAttributeNames() {
+                        return page.getRequest().getParameterNames();
+                    }
+                };
+            }
+            return this.paramValues;
+        }
+
+        public Map getRequestScope() {
+            if (this.requestScope == null) {
+                this.requestScope = new ScopeMap() {
+                    protected void setAttribute(String name, Object value) {
+                        page.getRequest().setAttribute(name, value);
+                    }
+
+                    protected void removeAttribute(String name) {
+                        page.getRequest().removeAttribute(name);
+                    }
+
+                    protected Enumeration getAttributeNames() {
+                        return page.getRequest().getAttributeNames();
+                    }
+
+                    protected Object getAttribute(String name) {
+                        return page.getAttribute(name);
+                    }
+                };
+            }
+            return this.requestScope;
+        }
+
+        public Map getSessionScope() {
+            if (this.sessionScope == null) {
+                this.sessionScope = new ScopeMap() {
+                    protected void setAttribute(String name, Object value) {
+                        ((HttpServletRequest) page.getRequest()).getSession()
+                                .setAttribute(name, value);
+                    }
+
+                    protected void removeAttribute(String name) {
+                        HttpSession session = page.getSession();
+                        if (session != null) {
+                            session.removeAttribute(name);
+                        }
+                    }
+
+                    protected Enumeration getAttributeNames() {
+                        HttpSession session = page.getSession();
+                        if (session != null) {
+                            return session.getAttributeNames();
+                        }
+                        return null;
+                    }
+
+                    protected Object getAttribute(String name) {
+                        HttpSession session = page.getSession();
+                        if (session != null) {
+                            return session.getAttribute(name);
+                        }
+                        return null;
+                    }
+                };
+            }
+            return this.sessionScope;
+        }
+    }
+
+    private abstract static class ScopeMap extends AbstractMap {
+
+        protected abstract Enumeration getAttributeNames();
+
+        protected abstract Object getAttribute(String name);
+
+        protected void removeAttribute(String name) {
+            throw new UnsupportedOperationException();
+        }
+
+        protected void setAttribute(String name, Object value) {
+            throw new UnsupportedOperationException();
+        }
+
+        public final Set entrySet() {
+            Enumeration e = getAttributeNames();
+            Set set = new HashSet();
+            if (e != null) {
+                while (e.hasMoreElements()) {
+                    set.add(new ScopeEntry((String) e.nextElement()));
+                }
+            }
+            return set;
+        }
+
+        private class ScopeEntry implements Map.Entry {
+
+            private final String key;
+
+            public ScopeEntry(String key) {
+                this.key = key;
+            }
+
+            public Object getKey() {
+                return (Object) this.key;
+            }
+
+            public Object getValue() {
+                return getAttribute(this.key);
+            }
+
+            public Object setValue(Object value) {
+                if (value == null) {
+                    removeAttribute(this.key);
+                } else {
+                    setAttribute(this.key, value);
+                }
+                return null;
+            }
+
+            public boolean equals(Object obj) {
+                return (obj != null && this.hashCode() == obj.hashCode());
+            }
+
+            public int hashCode() {
+                return this.key.hashCode();
+            }
+
+        }
+
+        public final Object get(Object key) {
+            if (key != null) {
+                return getAttribute(key.toString());
+            }
+            return null;
+        }
+
+        public final Object put(Object key, Object value) {
+            if (key == null) {
+                throw new NullPointerException();
+            }
+            if (value == null) {
+                this.removeAttribute(key.toString());
+            } else {
+                this.setAttribute(key.toString(), value);
+            }
+            return null;
+        }
+
+        public final Object remove(Object key) {
+            if (key == null) {
+                throw new NullPointerException();
+            }
+            this.removeAttribute(key.toString());
+            return null;
+        }
+
+    }
+
+}

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ScopedAttributeELResolver.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ScopedAttributeELResolver.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ScopedAttributeELResolver.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/ScopedAttributeELResolver.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,182 @@
+package javax.servlet.jsp.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+import javax.servlet.jsp.JspContext;
+import javax.servlet.jsp.PageContext;
+
+public class ScopedAttributeELResolver extends ELResolver {
+
+	public ScopedAttributeELResolver() {
+		super();
+	}
+
+	public Object getValue(ELContext context, Object base, Object property)
+			throws NullPointerException, PropertyNotFoundException, ELException {
+		if (context == null) {
+			throw new NullPointerException();
+		}
+
+		if (base == null) {
+			context.setPropertyResolved(true);
+			if (property != null) {
+				String key = property.toString();
+				PageContext page = (PageContext) context
+						.getContext(JspContext.class);
+				return page.findAttribute(key);
+			}
+		}
+
+		return null;
+	}
+
+	public Class<?> getType(ELContext context, Object base, Object property)
+			throws NullPointerException, PropertyNotFoundException, ELException {
+		if (context == null) {
+			throw new NullPointerException();
+		}
+
+		if (base == null) {
+			context.setPropertyResolved(true);
+			return Object.class;
+		}
+
+		return null;
+	}
+
+	public void setValue(ELContext context, Object base, Object property,
+			Object value) throws NullPointerException,
+			PropertyNotFoundException, PropertyNotWritableException,
+			ELException {
+		if (context == null) {
+			throw new NullPointerException();
+		}
+
+		if (base == null) {
+			context.setPropertyResolved(true);
+			if (property != null) {
+				String key = property.toString();
+				PageContext page = (PageContext) context
+						.getContext(JspContext.class);
+				int scope = page.getAttributesScope(key);
+				if (scope != 0) {
+					page.setAttribute(key, value, scope);
+				} else {
+					page.setAttribute(key, value);
+				}
+			}
+		}
+	}
+
+	public boolean isReadOnly(ELContext context, Object base, Object property)
+			throws NullPointerException, PropertyNotFoundException, ELException {
+		if (context == null) {
+			throw new NullPointerException();
+		}
+
+		if (base == null) {
+			context.setPropertyResolved(true);
+		}
+
+		return false;
+	}
+
+	public Iterator getFeatureDescriptors(ELContext context, Object base) {
+
+		PageContext ctxt = (PageContext) context.getContext(JspContext.class);
+		List list = new ArrayList();
+		Enumeration e;
+		Object value;
+		String name;
+
+		e = ctxt.getAttributeNamesInScope(PageContext.PAGE_SCOPE);
+		while (e.hasMoreElements()) {
+			name = (String) e.nextElement();
+			value = ctxt.getAttribute(name, PageContext.PAGE_SCOPE);
+			FeatureDescriptor descriptor = new FeatureDescriptor();
+			descriptor.setName(name);
+			descriptor.setDisplayName(name);
+			descriptor.setExpert(false);
+			descriptor.setHidden(false);
+			descriptor.setPreferred(true);
+			descriptor.setShortDescription("page scoped attribute");
+			descriptor.setValue("type", value.getClass());
+			descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+			list.add(descriptor);
+		}
+
+		e = ctxt.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);
+		while (e.hasMoreElements()) {
+			name = (String) e.nextElement();
+			value = ctxt.getAttribute(name, PageContext.REQUEST_SCOPE);
+			FeatureDescriptor descriptor = new FeatureDescriptor();
+			descriptor.setName(name);
+			descriptor.setDisplayName(name);
+			descriptor.setExpert(false);
+			descriptor.setHidden(false);
+			descriptor.setPreferred(true);
+			descriptor.setShortDescription("request scope attribute");
+			descriptor.setValue("type", value.getClass());
+			descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+			list.add(descriptor);
+		}
+
+		if (ctxt.getSession() != null) {
+			e = ctxt.getAttributeNamesInScope(PageContext.SESSION_SCOPE);
+			while (e.hasMoreElements()) {
+				name = (String) e.nextElement();
+				value = ctxt.getAttribute(name, PageContext.SESSION_SCOPE);
+				FeatureDescriptor descriptor = new FeatureDescriptor();
+				descriptor.setName(name);
+				descriptor.setDisplayName(name);
+				descriptor.setExpert(false);
+				descriptor.setHidden(false);
+				descriptor.setPreferred(true);
+				descriptor.setShortDescription("session scoped attribute");
+				descriptor.setValue("type", value.getClass());
+				descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+				list.add(descriptor);
+			}
+		}
+
+		e = ctxt.getAttributeNamesInScope(PageContext.APPLICATION_SCOPE);
+		while (e.hasMoreElements()) {
+			name = (String) e.nextElement();
+			value = ctxt.getAttribute(name, PageContext.APPLICATION_SCOPE);
+			FeatureDescriptor descriptor = new FeatureDescriptor();
+			descriptor.setName(name);
+			descriptor.setDisplayName(name);
+			descriptor.setExpert(false);
+			descriptor.setHidden(false);
+			descriptor.setPreferred(true);
+			descriptor.setShortDescription("application scoped attribute");
+			descriptor.setValue("type", value.getClass());
+			descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+			list.add(descriptor);
+		}
+		return list.iterator();
+	}
+
+	private static void appendEnumeration(Collection c, Enumeration e) {
+		while (e.hasMoreElements()) {
+			c.add(e.nextElement());
+		}
+	}
+
+	public Class<?> getCommonPropertyType(ELContext context, Object base) {
+		if (base == null) {
+			return String.class;
+		}
+		return null;
+	}
+}

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/VariableResolver.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/VariableResolver.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/VariableResolver.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/VariableResolver.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,50 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package javax.servlet.jsp.el;
+
+/**
+ * <p>This class is used to customize the way an ExpressionEvaluator resolves
+ * variable references at evaluation time.  For example, instances of this class can
+ * implement their own variable lookup mechanisms, or introduce the
+ * notion of "implicit variables" which override any other variables.
+ * An instance of this class should be passed when evaluating
+ * an expression.</p>
+ *
+ * <p>An instance of this class includes the context against which resolution
+ * will happen</p>
+ *
+ * @since 2.0
+ * @deprecated
+ */
+public interface VariableResolver
+{
+  //-------------------------------------
+  /**
+   * Resolves the specified variable.
+   * Returns null if the variable is not found.
+   * 
+   * @param pName the name of the variable to resolve
+   * @return the result of the variable resolution
+   *
+   * @throws ELException if a failure occurred while trying to resolve
+   *     the given variable
+   **/
+  public Object resolveVariable (String pName)
+    throws ELException;
+					
+  //-------------------------------------
+}

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/package.html
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/package.html?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/package.html (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/el/package.html Tue Feb 21 07:46:36 2006
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<!--
+  - The Apache Software License, Version 1.1
+  -
+  - Copyright (c) 1999 The Apache Software Foundation.  All rights 
+  - reserved.
+  -
+  - Redistribution and use in source and binary forms, with or without
+  - modification, are permitted provided that the following conditions
+  - are met:
+  -
+  - 1. Redistributions of source code must retain the above copyright
+  -    notice, this list of conditions and the following disclaimer. 
+  -
+  - 2. Redistributions in binary form must reproduce the above copyright
+  -    notice, this list of conditions and the following disclaimer in
+  -    the documentation and/or other materials provided with the
+  -    distribution.
+  -
+  - 3. The end-user documentation included with the redistribution, if
+  -    any, must include the following acknowlegement:  
+  -       "This product includes software developed by the 
+  -        Apache Software Foundation (http://www.apache.org/)."
+  -    Alternately, this acknowlegement may appear in the software itself,
+  -    if and wherever such third-party acknowlegements normally appear.
+  -
+  - 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
+  -    Foundation" must not be used to endorse or promote products derived
+  -    from this software without prior written permission. For written 
+  -    permission, please contact apache@apache.org.
+  -
+  - 5. Products derived from this software may not be called "Apache"
+  -    nor may "Apache" appear in their names without prior written
+  -    permission of the Apache Group.
+  -
+  - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+  - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+  - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+  - DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+  - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+  - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+  - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+  - OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  - SUCH DAMAGE.
+  - ====================================================================
+  -
+  - This software consists of voluntary contributions made by many
+  - individuals on behalf of the Apache Software Foundation.  For more
+  - information on the Apache Software Foundation, please see
+  - <http://www.apache.org/>.
+  -
+  -->
+</head>
+<body bgcolor="white">
+
+Classes and interfaces for the JSP 2.0 Expression Language API.
+
+<p>
+The JavaServer Pages(tm) (JSP) 2.0 specification provides a portable
+API for evaluating "EL Expressions".  As of JSP 2.0, EL expressions can
+be placed directly in the template text of JSP pages and tag files.
+<p>
+This package contains a number of classes and interfaces that describe 
+and define programmatic access to the Expression Language evaluator. 
+This API can also be used by an implementation of JSP to evaluate the 
+expressions, but other implementations, like open-coding into Java 
+bytecodes, are allowed.  This package is intended to have no dependencies 
+on other portions of the JSP 2.0 specification. 
+</body>
+</html>

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/package.html
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/package.html?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/package.html (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/package.html Tue Feb 21 07:46:36 2006
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<!--
+  - The Apache Software License, Version 1.1
+  -
+  - Copyright (c) 1999 The Apache Software Foundation.  All rights 
+  - reserved.
+  -
+  - Redistribution and use in source and binary forms, with or without
+  - modification, are permitted provided that the following conditions
+  - are met:
+  -
+  - 1. Redistributions of source code must retain the above copyright
+  -    notice, this list of conditions and the following disclaimer. 
+  -
+  - 2. Redistributions in binary form must reproduce the above copyright
+  -    notice, this list of conditions and the following disclaimer in
+  -    the documentation and/or other materials provided with the
+  -    distribution.
+  -
+  - 3. The end-user documentation included with the redistribution, if
+  -    any, must include the following acknowlegement:  
+  -       "This product includes software developed by the 
+  -        Apache Software Foundation (http://www.apache.org/)."
+  -    Alternately, this acknowlegement may appear in the software itself,
+  -    if and wherever such third-party acknowlegements normally appear.
+  -
+  - 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
+  -    Foundation" must not be used to endorse or promote products derived
+  -    from this software without prior written permission. For written 
+  -    permission, please contact apache@apache.org.
+  -
+  - 5. Products derived from this software may not be called "Apache"
+  -    nor may "Apache" appear in their names without prior written
+  -    permission of the Apache Group.
+  -
+  - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+  - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+  - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+  - DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+  - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+  - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+  - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+  - OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  - SUCH DAMAGE.
+  - ====================================================================
+  -
+  - This software consists of voluntary contributions made by many
+  - individuals on behalf of the Apache Software Foundation.  For more
+  - information on the Apache Software Foundation, please see
+  - <http://www.apache.org/>.
+  -
+  -->
+</head>
+<body bgcolor="white">
+Classes and interfaces for the Core JSP 2.0 API.
+<p>
+The javax.servlet.jsp package contains a number of classes and
+interfaces that describe and define the contracts between a JSP page
+implementation class and the runtime environment provided for an
+instance of such a class by a conforming JSP container.
+</body>
+</html>

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyContent.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyContent.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyContent.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyContent.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,138 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/ 
+package javax.servlet.jsp.tagext;
+
+import java.io.Reader;
+import java.io.Writer;
+import java.io.IOException;
+import javax.servlet.jsp.*;
+
+/**
+ * An encapsulation of the evaluation of the body of an action so it is
+ * available to a tag handler.  BodyContent is a subclass of JspWriter.
+ *
+ * <p>
+ * Note that the content of BodyContent is the result of evaluation, so
+ * it will not contain actions and the like, but the result of their
+ * invocation.
+ * 
+ * <p>
+ * BodyContent has methods to convert its contents into
+ * a String, to read its contents, and to clear the contents.
+ *
+ * <p>
+ * The buffer size of a BodyContent object is unbounded.  A
+ * BodyContent object cannot be in autoFlush mode.  It is not possible to
+ * invoke flush on a BodyContent object, as there is no backing stream.
+ *
+ * <p>
+ * Instances of BodyContent are created by invoking the pushBody and
+ * popBody methods of the PageContext class.  A BodyContent is enclosed
+ * within another JspWriter (maybe another BodyContent object) following
+ * the structure of their associated actions.
+ *
+ * <p>
+ * A BodyContent is made available to a BodyTag through a setBodyContent()
+ * call.  The tag handler can use the object until after the call to
+ * doEndTag().
+ */
+
+public abstract class BodyContent extends JspWriter {
+    
+    /**
+     * Protected constructor.
+     *
+     * Unbounded buffer, no autoflushing.
+     *
+     * @param e the enclosing JspWriter
+     */
+
+    protected BodyContent(JspWriter e) {
+	super(UNBOUNDED_BUFFER , false);
+	this.enclosingWriter = e;
+    }
+
+    /**
+     * Redefined flush() so it is not legal.
+     *
+     * <p>
+     * It is not valid to flush a BodyContent because there is no backing
+     * stream behind it.
+     *
+     * @throws IOException always thrown
+     */
+
+    public void flush() throws IOException {
+	throw new IOException("Illegal to flush within a custom tag");
+    }
+
+    /**
+     * Clear the body without throwing any exceptions.
+     */
+    
+    public void clearBody() {
+	try {
+	    this.clear();
+	} catch (IOException ex) {
+	    // TODO -- clean this one up.
+	    throw new Error("internal error!;");
+	}
+    }
+
+    /**
+     * Return the value of this BodyContent as a Reader.
+     *
+     * @return the value of this BodyContent as a Reader
+     */
+    public abstract Reader getReader();
+
+
+    /**
+     * Return the value of the BodyContent as a String.
+     *
+     * @return the value of the BodyContent as a String
+     */
+    public abstract String getString();
+	
+
+    /**
+     * Write the contents of this BodyContent into a Writer.
+     * Subclasses may optimize common invocation patterns.
+     *
+     * @param out The writer into which to place the contents of
+     *     this body evaluation
+     * @throws IOException if an I/O error occurred while writing the
+     *     contents of this BodyContent to the given Writer
+     */
+
+    public abstract void writeOut(Writer out) throws IOException;
+
+
+    /**
+     * Get the enclosing JspWriter.
+     *
+     * @return the enclosing JspWriter passed at construction time
+     */
+
+    public JspWriter getEnclosingWriter() {
+	return enclosingWriter;
+    }
+
+
+    // private fields
+
+    private JspWriter enclosingWriter;
+ }

Added: tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyTag.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyTag.java?rev=379499&view=auto
==============================================================================
--- tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyTag.java (added)
+++ tomcat/jasper/tc6.0.x/src/share/javax/servlet/jsp/tagext/BodyTag.java Tue Feb 21 07:46:36 2006
@@ -0,0 +1,185 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.servlet.jsp.tagext;
+
+import javax.servlet.jsp.*;
+
+/**
+ * The BodyTag interface extends IterationTag by defining additional
+ * methods that let a tag handler manipulate the content of evaluating its body.
+ *
+ * <p>
+ * It is the responsibility of the tag handler to manipulate the body
+ * content.  For example the tag handler may take the body content,
+ * convert it into a String using the bodyContent.getString
+ * method and then use it.  Or the tag handler may take the body
+ * content and write it out into its enclosing JspWriter using
+ * the bodyContent.writeOut method.
+ *
+ * <p> A tag handler that implements BodyTag is treated as one that
+ * implements IterationTag, except that the doStartTag method can
+ * return SKIP_BODY, EVAL_BODY_INCLUDE or EVAL_BODY_BUFFERED.
+ *
+ * <p>
+ * If EVAL_BODY_INCLUDE is returned, then evaluation happens
+ * as in IterationTag.
+ *
+ * <p>
+ * If EVAL_BODY_BUFFERED is returned, then a BodyContent object will be
+ * created (by code generated by the JSP compiler) to capture the body
+ * evaluation.
+ * The code generated by the JSP compiler obtains the BodyContent object by
+ * calling the pushBody method of the current pageContext, which
+ * additionally has the effect of saving the previous out value.
+ * The page compiler returns this object by calling the popBody
+ * method of the PageContext class;
+ * the call also restores the value of out.
+ *
+ * <p>
+ * The interface provides one new property with a setter method and one
+ * new action method.
+ *
+ * <p><B>Properties</B>
+ * <p> There is a new property: bodyContent, to contain the BodyContent
+ * object, where the JSP Page implementation object will place the
+ * evaluation (and reevaluation, if appropriate) of the body.  The setter
+ * method (setBodyContent) will only be invoked if doStartTag() returns
+ * EVAL_BODY_BUFFERED and the corresponding action element does not have
+ * an empty body.
+ *
+ * <p><B>Methods</B>
+ * <p> In addition to the setter method for the bodyContent property, there
+ * is a new action method: doInitBody(), which is invoked right after
+ * setBodyContent() and before the body evaluation.  This method is only
+ * invoked if doStartTag() returns EVAL_BODY_BUFFERED.
+ *
+ * <p><B>Lifecycle</B>
+ * <p> Lifecycle details are described by the transition diagram below.
+ * Exceptions that are thrown during the computation of doStartTag(),
+ * setBodyContent(), doInitBody(), BODY, doAfterBody() interrupt the
+ * execution sequence and are propagated up the stack, unless the
+ * tag handler implements the TryCatchFinally interface; see that
+ * interface for details.
+ * <p>
+ * <IMG src="doc-files/BodyTagProtocol.gif"
+ *      alt="Lifecycle Details Transition Diagram for BodyTag"/>
+ *
+ * <p><B>Empty and Non-Empty Action</B>
+ * <p> If the TagLibraryDescriptor file indicates that the action must
+ * always have an empty element body, by an &lt;body-content&gt; entry 
+ * of "empty", then the doStartTag() method must return SKIP_BODY.
+ * Otherwise, the doStartTag() method may return SKIP_BODY,
+ * EVAL_BODY_INCLUDE, or EVAL_BODY_BUFFERED.
+ *
+ * <p>Note that which methods are invoked after the doStartTag() depends on 
+ * both the return value and on if the custom action element is empty
+ * or not in the JSP page, not how it's declared in the TLD.
+ *
+ * <p>
+ * If SKIP_BODY is returned the body is not evaluated, and doEndTag() is
+ * invoked.
+ *
+ * <p>
+ * If EVAL_BODY_INCLUDE is returned, and the custom action element is not
+ * empty, setBodyContent() is not invoked,
+ * doInitBody() is not invoked, the body is evaluated and
+ * "passed through" to the current out, doAfterBody() is invoked
+ * and then, after zero or more iterations, doEndTag() is invoked.
+ * If the custom action element is empty, only doStart() and 
+ * doEndTag() are invoked.
+ *
+ * <p>
+ * If EVAL_BODY_BUFFERED is returned, and the custom action element is not
+ * empty, setBodyContent() is invoked,
+ * doInitBody() is invoked, the body is evaluated, doAfterBody() is
+ * invoked, and then, after zero or more iterations, doEndTag() is invoked.
+ * If the custom action element is empty, only doStart() and doEndTag() 
+ * are invoked.
+ */
+
+public interface BodyTag extends IterationTag {
+
+    /**
+     * Deprecated constant that has the same value as EVAL_BODY_BUFFERED
+     * and EVAL_BODY_AGAIN.  This name has been marked as deprecated
+     * to encourage the use of the two different terms, which are much
+     * more descriptive.
+     *
+     * @deprecated	As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED
+     * or IterationTag.EVAL_BODY_AGAIN.
+     */
+ 
+    public final static int EVAL_BODY_TAG = 2;
+
+    /**
+     * Request the creation of new buffer, a BodyContent on which to
+     * evaluate the body of this tag.
+     *
+     * Returned from doStartTag when it implements BodyTag.
+     * This is an illegal return value for doStartTag when the class
+     * does not implement BodyTag.
+     */
+
+    public final static int EVAL_BODY_BUFFERED = 2;
+
+
+    /**
+     * Set the bodyContent property.
+     * This method is invoked by the JSP page implementation object at
+     * most once per action invocation.
+     * This method will be invoked before doInitBody.
+     * This method will not be invoked for empty tags or for non-empty
+     * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.
+     *
+     * <p>
+     * When setBodyContent is invoked, the value of the implicit object out
+     * has already been changed in the pageContext object.  The BodyContent
+     * object passed will have not data on it but may have been reused
+     * (and cleared) from some previous invocation.
+     *
+     * <p>
+     * The BodyContent object is available and with the appropriate content
+     * until after the invocation of the doEndTag method, at which case it
+     * may be reused.
+     *
+     * @param b the BodyContent
+     * @see #doInitBody
+     * @see #doAfterBody
+     */
+
+    void setBodyContent(BodyContent b);
+
+
+    /**
+     * Prepare for evaluation of the body.
+     * This method is invoked by the JSP page implementation object
+     * after setBodyContent and before the first time
+     * the body is to be evaluated.
+     * This method will not be invoked for empty tags or for non-empty
+     * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.
+     *
+     * <p>
+     * The JSP container will resynchronize the values of any AT_BEGIN and
+     * NESTED variables (defined by the associated TagExtraInfo or TLD) after
+     * the invocation of doInitBody().
+     *
+     * @throws JspException if an error occurred while processing this tag
+     * @see #doAfterBody
+     */
+
+    void doInitBody() throws JspException;
+
+}



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


Mime
View raw message