kinman 2002/08/08 13:33:14 Modified: src/share/javax/servlet/jsp JspTagException.java PageContext.java src/share/javax/servlet/jsp/tagext DynamicAttributes.java JspFragment.java SimpleTag.java SimpleTagSupport.java Added: src/share/javax/servlet/jsp SkipPageException.java Removed: src/share/javax/servlet/jsp/tagext AttributeNotSupportedException.java Log: - JSP2.0 API updates Submitted by: Mark Roth Revision Changes Path 1.2 +55 -4 jakarta-servletapi-5/src/share/javax/servlet/jsp/JspTagException.java Index: JspTagException.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/JspTagException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JspTagException.java 16 Jul 2002 16:38:41 -0000 1.1 +++ JspTagException.java 8 Aug 2002 20:33:14 -0000 1.2 @@ -63,16 +63,67 @@ public class JspTagException extends JspException { /** - * Constructor with a message. - */ + * Constructs a new JspTagException 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 JspTagException(String msg) { - super(msg); + super( msg ); } /** - * No message + * Constructs a new JspTagException with no message. */ public JspTagException() { super(); } + + /** + * Constructs a new JspTagException when the JSP Tag + * 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 JSP Tag's + * normal operation, making this JSP Tag + * exception necessary + * + */ + public JspTagException(String message, Throwable rootCause) { + super( message, rootCause ); + } + + + /** + * Constructs a new JSP Tag exception when the JSP Tag + * 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>JspTagException</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 Tag's + * normal operation, making the JSP Tag + * exception necessary + * + */ + + public JspTagException(Throwable rootCause) { + super( rootCause ); + } + } 1.2 +0 -3 jakarta-servletapi-5/src/share/javax/servlet/jsp/PageContext.java Index: PageContext.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/PageContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PageContext.java 16 Jul 2002 16:38:41 -0000 1.1 +++ PageContext.java 8 Aug 2002 20:33:14 -0000 1.2 @@ -113,9 +113,6 @@ * <p> * The following methods enable the <B>management of nested</B> JspWriter streams to * implement Tag Extensions: <code>pushBody()</code> and <code>popBody()</code> - * To facilitate Simple Tag Extensions, the <code>pushPageScope()</code>, - * <code>popPageScope()</code> and <code>peekPageScope()</code> methods are - * added. * * <p><B>Methods Intended for JSP authors</B> * <p> 1.1 jakarta-servletapi-5/src/share/javax/servlet/jsp/SkipPageException.java Index: SkipPageException.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 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. * * @see javax.servlet.jsp.tagext.SimpleTag#doTag * @see javax.servlet.jsp.tagext.JspFragment#invoke * @see javax.servlet.jsp.tagext.Tag#doEndTag */ public class SkipPageException extends JspException { /** * Creates a SkipPageException with no message. */ public SkipPageException() { super(); } /** * Creates a SkipPageException with the provided message. */ public SkipPageException( String message ) { super( message ); } /** * Creates a SkipPageException with the provided message and root cause. */ public SkipPageException( String message, Throwable rootCause ) { super( message, rootCause ); } /** * Creates a SkipPageException with the provided root cause. */ public SkipPageException( Throwable rootCause ) { super( rootCause ); } } 1.3 +3 -6 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/DynamicAttributes.java Index: DynamicAttributes.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/DynamicAttributes.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DynamicAttributes.java 30 Jul 2002 22:59:46 -0000 1.2 +++ DynamicAttributes.java 8 Aug 2002 20:33:14 -0000 1.3 @@ -76,15 +76,12 @@ * namespace. * @param localName the name of the attribute being set. * @param value the value of the attribute - * @throws AttributeNotSupportedException if the tag handler wishes to + * @throws JspException if the tag handler wishes to * signal that it does not accept the given attribute. The - * container must catch this exception and rethrow a JspException - * to the calling page before calling doStartTag() or doTag(). - * If a message is provided in the AttributeNotSupportedException, - * the corresponding JspException must contain the same message. + * container must not call doStartTag() or doTag() for this tag. */ public void setDynamicAttribute( String uri, String localName, Object value ) - throws AttributeNotSupportedException; + throws javax.servlet.jsp.JspException; } 1.2 +5 -0 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/JspFragment.java Index: JspFragment.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/JspFragment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JspFragment.java 16 Jul 2002 16:38:41 -0000 1.1 +++ JspFragment.java 8 Aug 2002 20:33:14 -0000 1.2 @@ -98,6 +98,11 @@ * values are parameter values. This allows the invoker to * parameterize a fragment invocation. * @throws javax.servlet.jsp.JspException + * @throws javax.servlet.jsp.SkipPageException Thrown if the page + * that (either directly or indirectly) invoked the tag handler that + * invoked this fragment is to cease evaluation. The container + * must throw this exception if a Classic Tag Handler returned + * Tag.SKIP_PAGE or if a Simple Tag Handler threw SkipPageException. */ public void invoke( java.io.Writer out, java.util.Map params ) 1.3 +10 -14 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTag.java Index: SimpleTag.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SimpleTag.java 30 Jul 2002 22:59:46 -0000 1.2 +++ SimpleTag.java 8 Aug 2002 20:33:14 -0000 1.3 @@ -79,26 +79,22 @@ public interface SimpleTag extends JspTag { - /** - * Skip the rest of the page. - * Valid return value for doTag(). - */ - public final static int SKIP_PAGE = 5; - - /** - * Continue evaluating the page. - * Valid return value for doTag(). - */ - public final static int EVAL_PAGE = 6; - /** * Called by the container to invoke this tag. * The implementation of this method is provided by the tag library * developer, and handles all tag processing, body iteration, etc. * - * @return SKIP_PAGE to abort the processing, or EVAL_PAGE to continue. + * @throws javax.servlet.jsp.JspException If an error occurred + * while processing this tag. + * @throws javax.servlet.jsp.SkipPageException If the page that + * (either directly or indirectly) invoked this tag is to + * cease evaluation. A Simple Tag Handler generated from a + * tag file must throw this exception if an invoked Classic + * Tag Handler returned SKIP_PAGE or if an invoked Simple + * Tag Handler threw SkipPageException or if an invoked Jsp Fragment + * threw a SkipPageException. */ - public int doTag() + public void doTag() throws javax.servlet.jsp.JspException; /** 1.3 +4 -7 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTagSupport.java Index: SimpleTagSupport.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTagSupport.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SimpleTagSupport.java 30 Jul 2002 22:59:46 -0000 1.2 +++ SimpleTagSupport.java 8 Aug 2002 20:33:14 -0000 1.3 @@ -72,22 +72,19 @@ private JspTag parentTag; /** The JSP context for the upcoming tag invocation */ - private JspContext jspContext; + protected JspContext jspContext; /** The body of the tag */ - private JspFragment jspBody; + protected JspFragment jspBody; /** - * Default processing of the tag returning EVAL_PAGE. - * - * @return EVAL_PAGE + * Default processing of the tag does nothing. * * @see SimpleTag#doTag() */ - public int doTag() + public void doTag() throws javax.servlet.jsp.JspException { - return EVAL_PAGE; } /**
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>