From debcf62122b66d8825388a1edbfc8285655a40ca Mon Sep 17 00:00:00 2001
From: markt
* Stores application-scoped information for the JSP container.
*
- * Registers an
- * At the very least, any
- * Adds an
- * JSP has a default set of ELResolvers to chain for all EL evaluation:
- * ELContextListener that will notified whenever
- * a new ELContext is created.
- * ELContext instantiated will have reference
- * to the JspContext under JspContext.class.
- * ELResolver to the chain of EL variable and property management
- * within JSP pages and Tag files.
- *
- *
- * ImplicitObjectELResolverELResolver instances registered with this methodMapELResolverListELResolverArrayELResolverBeanELResolverScopedAttributeELResolver
ServletContextListeners have been initialized.
- */
- public void addELResolver(ELResolver resolver) throws IllegalStateException;
-
- /**
- *
- * Returns the JSP container's ExpressionFactory implementation for EL use.
- *
ExpressionFactory implementation
- */
- public ExpressionFactory getExpressionFactory();
-
+ /**
+ *
+ * Registers an ELContextListener that will notified whenever a
+ * new ELContext is created.
+ *
+ * At the very least, any ELContext instantiated will have
+ * reference to the JspContext under
+ * JspContext.class.
+ *
+ * Adds an ELResolver to the chain of EL variable and property
+ * management within JSP pages and Tag files.
+ *
+ * JSP has a default set of ELResolvers to chain for all EL evaluation: + *
ImplicitObjectELResolverELResolver instances registered with this methodMapELResolverListELResolverArrayELResolverBeanELResolverScopedAttributeELResolverServletContextListeners have been initialized.
+ */
+ public void addELResolver(ELResolver resolver) throws IllegalStateException;
+
+ /**
+ *
+ * Returns the JSP container's ExpressionFactory implementation
+ * for EL use.
+ *
ExpressionFactory implementation
+ */
+ public ExpressionFactory getExpressionFactory();
+
}
diff --git a/java/javax/servlet/jsp/JspTagException.java b/java/javax/servlet/jsp/JspTagException.java
index 5f37b3f65..d15e3c1d2 100644
--- a/java/javax/servlet/jsp/JspTagException.java
+++ b/java/javax/servlet/jsp/JspTagException.java
@@ -1,93 +1,83 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 be used by a Tag Handler to indicate some unrecoverable
- * error.
+ * Exception to be used by a Tag Handler to indicate some unrecoverable error.
* This error is to be caught by the top level of the JSP page and will result
* in an error page.
*/
-
public class JspTagException extends JspException {
+
/**
- * Constructs a new JspTagException with the specified message.
- * The message can be written to the server log and/or displayed
- * for the user.
+ * 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 String specifying the text of
- * the exception message
+ * @param msg
+ * a String specifying the text of the exception
+ * message
*/
public JspTagException(String msg) {
- super( msg );
+ super(msg);
}
/**
* Constructs a new JspTagException with no message.
*/
public JspTagException() {
- super();
+ 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 String containing
- * the text of the exception message
- *
- * @param rootCause the Throwable exception
- * that interfered with the JSP Tag's
- * normal operation, making this JSP Tag
- * exception necessary
- *
+ * 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 String containing the text of the exception
+ * message
+ * @param rootCause
+ * the Throwable exception that interfered with the
+ * JSP Tag's normal operation, making this JSP Tag exception
+ * necessary
* @since 2.0
*/
public JspTagException(String message, Throwable rootCause) {
- super( message, 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.
- *
- * This method calls the getLocalizedMessage method
- * on the Throwable exception to get a localized exception
- * message. When subclassing JspTagException,
- * this method can be overridden to create an exception message
- * designed for a specific locale.
- *
- * @param rootCause the Throwable exception
- * that interfered with the JSP Tag's
- * normal operation, making the JSP Tag
- * exception necessary
- *
+ * 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.
+ *
+ * This method calls the getLocalizedMessage method on the
+ * Throwable exception to get a localized exception message.
+ * When subclassing JspTagException, this method can be
+ * overridden to create an exception message designed for a specific locale.
+ *
+ * @param rootCause
+ * the Throwable exception that interfered with the
+ * JSP Tag's normal operation, making the JSP Tag exception
+ * necessary
* @since 2.0
*/
-
public JspTagException(Throwable rootCause) {
- super( rootCause );
+ super(rootCause);
}
-
}
diff --git a/java/javax/servlet/jsp/JspWriter.java b/java/javax/servlet/jsp/JspWriter.java
index c50558d65..2c1cc74fb 100644
--- a/java/javax/servlet/jsp/JspWriter.java
+++ b/java/javax/servlet/jsp/JspWriter.java
@@ -1,433 +1,446 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You 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.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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;
/**
*
- * The actions and template data in a JSP page is written using the - * JspWriter object that is referenced by the implicit variable out which - * is initialized automatically using methods in the PageContext object. + * The actions and template data in a JSP page is written using the JspWriter + * object that is referenced by the implicit variable out which is initialized + * automatically using methods in the PageContext object. *
* This abstract class emulates some of the functionality found in the - * java.io.BufferedWriter and java.io.PrintWriter classes, - * however it differs in that it throws java.io.IOException from the print - * methods while PrintWriter does not. - *
Buffering + * java.io.BufferedWriter and java.io.PrintWriter classes, however it differs in + * that it throws java.io.IOException from the print methods while PrintWriter + * does not. + *
+ * Buffering *
- * The initial JspWriter object is associated with the PrintWriter object - * of the ServletResponse in a way that depends on whether the page is or - * is not buffered. If the page is not buffered, output written to this - * JspWriter object will be written through to the PrintWriter directly, - * which will be created if necessary by invoking the getWriter() method - * on the response object. But if the page is buffered, the PrintWriter - * object will not be created until the buffer is flushed and - * operations like setContentType() are legal. Since this flexibility - * simplifies programming substantially, buffering is the default for JSP - * pages. + * The initial JspWriter object is associated with the PrintWriter object of the + * ServletResponse in a way that depends on whether the page is or is not + * buffered. If the page is not buffered, output written to this JspWriter + * object will be written through to the PrintWriter directly, which will be + * created if necessary by invoking the getWriter() method on the response + * object. But if the page is buffered, the PrintWriter object will not be + * created until the buffer is flushed and operations like setContentType() are + * legal. Since this flexibility simplifies programming substantially, buffering + * is the default for JSP pages. *
- * Buffering raises the issue of what to do when the buffer is - * exceeded. Two approaches can be taken: + * Buffering raises the issue of what to do when the buffer is exceeded. Two + * approaches can be taken: *
- * Both approaches are valid, and thus both are supported in the JSP - * technology. The behavior of a page is controlled by the autoFlush - * attribute, which defaults to true. In general, JSP pages that need to - * be sure that correct and complete data has been sent to their client - * may want to set autoFlush to false, with a typical case being that - * where the client is an application itself. On the other hand, JSP - * pages that send data that is meaningful even when partially - * constructed may want to set autoFlush to true; such as when the - * data is sent for immediate display through a browser. Each application + * Both approaches are valid, and thus both are supported in the JSP technology. + * The behavior of a page is controlled by the autoFlush attribute, which + * defaults to true. In general, JSP pages that need to be sure that correct and + * complete data has been sent to their client may want to set autoFlush to + * false, with a typical case being that where the client is an application + * itself. On the other hand, JSP pages that send data that is meaningful even + * when partially constructed may want to set autoFlush to true; such as when + * the data is sent for immediate display through a browser. Each application * will need to consider their specific needs. *
- * An alternative considered was to make the buffer size unbounded; but, - * this had the disadvantage that runaway computations would consume an - * unbounded amount of resources. + * An alternative considered was to make the buffer size unbounded; but, this + * had the disadvantage that runaway computations would consume an unbounded + * amount of resources. *
- * The "out" implicit variable of a JSP implementation class is of this type.
- * If the page directive selects autoflush="true" then all the I/O operations
- * on this class shall automatically flush the contents of the buffer if an
+ * The "out" implicit variable of a JSP implementation class is of this type. If
+ * the page directive selects autoflush="true" then all the I/O operations on
+ * this class shall automatically flush the contents of the buffer if an
* overflow condition would result if the current operation were performed
* without a flush. If autoflush="false" then all the I/O operations on this
* class shall throw an IOException if performing the current operation would
* result in a buffer overflow condition.
- *
+ *
* @see java.io.Writer
* @see java.io.BufferedWriter
* @see java.io.PrintWriter
*/
-
abstract public class JspWriter extends java.io.Writer {
/**
* Constant indicating that the Writer is not buffering output.
*/
-
- public static final int NO_BUFFER = 0;
+ public static final int NO_BUFFER = 0;
/**
* Constant indicating that the Writer is buffered and is using the
* implementation default buffer size.
*/
-
- public static final int DEFAULT_BUFFER = -1;
+ public static final int DEFAULT_BUFFER = -1;
/**
- * Constant indicating that the Writer is buffered and is unbounded; this
- * is used in BodyContent.
+ * Constant indicating that the Writer is buffered and is unbounded; this is
+ * used in BodyContent.
*/
-
- public static final int UNBOUNDED_BUFFER = -2;
+ public static final int UNBOUNDED_BUFFER = -2;
/**
* Protected constructor.
- *
- * @param bufferSize the size of the buffer to be used by the JspWriter
- * @param autoFlush whether the JspWriter should be autoflushing
+ *
+ * @param bufferSize
+ * the size of the buffer to be used by the JspWriter
+ * @param autoFlush
+ * whether the JspWriter should be autoflushing
*/
-
protected JspWriter(int bufferSize, boolean autoFlush) {
- this.bufferSize = bufferSize;
- this.autoFlush = autoFlush;
+ this.bufferSize = bufferSize;
+ this.autoFlush = autoFlush;
}
/**
- * Write a line separator. The line separator string is defined by the
+ * Write a line separator. The line separator string is defined by the
* system property line.separator, and is not necessarily a single
* newline ('\n') character.
- *
- * @exception IOException If an I/O error occurs
+ *
+ * @exception IOException
+ * If an I/O error occurs
*/
-
abstract public void newLine() throws IOException;
/**
- * Print a boolean value. The string produced by {@link
- * java.lang.String#valueOf(boolean)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param b The boolean to be printed
- * @throws java.io.IOException If an error occurred while writing
+ * Print a boolean value. The string produced by {@link
+ * java.lang.String#valueOf(boolean)}
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param b
+ * The boolean to be printed
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(boolean b) throws IOException;
/**
- * Print a character. The character is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param c The char to be printed
- * @throws java.io.IOException If an error occurred while writing
+ * Print a character. The character is written to the JspWriter's buffer or,
+ * if no buffer is used, directly to the underlying writer.
+ *
+ * @param c
+ * The char to be printed
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(char c) throws IOException;
/**
- * Print an integer. The string produced by {@link
- * java.lang.String#valueOf(int)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param i The int to be printed
- * @see java.lang.Integer#toString(int)
- * @throws java.io.IOException If an error occurred while writing
+ * Print an integer. The string produced by {@link
+ * java.lang.String#valueOf(int)}
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param i
+ * The int to be printed
+ * @see java.lang.Integer#toString(int)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(int i) throws IOException;
/**
- * Print a long integer. The string produced by {@link
- * java.lang.String#valueOf(long)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param l The long to be printed
- * @see java.lang.Long#toString(long)
- * @throws java.io.IOException If an error occurred while writing
+ * Print a long integer. The string produced by {@link
+ * java.lang.String#valueOf(long)}
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param l
+ * The long to be printed
+ * @see java.lang.Long#toString(long)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(long l) throws IOException;
/**
- * Print a floating-point number. The string produced by {@link
- * java.lang.String#valueOf(float)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param f The float to be printed
- * @see java.lang.Float#toString(float)
- * @throws java.io.IOException If an error occurred while writing
+ * Print a floating-point number. The string produced by {@link
+ * java.lang.String#valueOf(float)}
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param f
+ * The float to be printed
+ * @see java.lang.Float#toString(float)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(float f) throws IOException;
/**
- * Print a double-precision floating-point number. The string produced by
- * {@link java.lang.String#valueOf(double)} is written to
- * the JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param d The double to be printed
- * @see java.lang.Double#toString(double)
- * @throws java.io.IOException If an error occurred while writing
+ * Print a double-precision floating-point number. The string produced by
+ * {@link java.lang.String#valueOf(double)} is written to the
+ * JspWriter's buffer or, if no buffer is used, directly to the underlying
+ * writer.
+ *
+ * @param d
+ * The double to be printed
+ * @see java.lang.Double#toString(double)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(double d) throws IOException;
/**
- * Print an array of characters. The characters are written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param s The array of chars to be printed
- *
- * @throws NullPointerException If s is null
- * @throws java.io.IOException If an error occurred while writing
+ * Print an array of characters. The characters are written to the
+ * JspWriter's buffer or, if no buffer is used, directly to the underlying
+ * writer.
+ *
+ * @param s
+ * The array of chars to be printed
+ * @throws NullPointerException
+ * If s is null
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(char s[]) throws IOException;
/**
- * Print a string. If the argument is null then the string
- * "null" is printed. Otherwise, the string's characters are
- * written to the JspWriter's buffer or, if no buffer is used, directly
- * to the underlying writer.
- *
- * @param s The String to be printed
- * @throws java.io.IOException If an error occurred while writing
+ * Print a string. If the argument is null then the string
+ * "null" is printed. Otherwise, the string's characters are
+ * written to the JspWriter's buffer or, if no buffer is used, directly to
+ * the underlying writer.
+ *
+ * @param s
+ * The String to be printed
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(String s) throws IOException;
/**
- * Print an object. The string produced by the {@link
- * java.lang.String#valueOf(Object)} method is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param obj The Object to be printed
- * @see java.lang.Object#toString()
- * @throws java.io.IOException If an error occurred while writing
+ * Print an object. The string produced by the {@link
+ * java.lang.String#valueOf(Object)}
+ * method is written to the JspWriter's buffer or, if no buffer is used,
+ * directly to the underlying writer.
+ *
+ * @param obj
+ * The Object to be printed
+ * @see java.lang.Object#toString()
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(Object obj) throws IOException;
/**
- * Terminate the current line by writing the line separator string. The
- * line separator string is defined by the system property
+ * Terminate the current line by writing the line separator string. The line
+ * separator string is defined by the system property
* line.separator, and is not necessarily a single newline
* character ('\n').
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println() throws IOException;
/**
- * Print a boolean value and then terminate the line. This method behaves
- * as though it invokes {@link #print(boolean)} and then
+ * Print a boolean value and then terminate the line. This method behaves as
+ * though it invokes {@link #print(boolean)} and then
* {@link #println()}.
- *
- * @param x the boolean to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the boolean to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(boolean x) throws IOException;
/**
- * Print a character and then terminate the line. This method behaves as
+ * Print a character and then terminate the line. This method behaves as
* though it invokes {@link #print(char)} and then {@link
- * #println()}.
- *
- * @param x the char to write
- * @throws java.io.IOException If an error occurred while writing
+ * #println()}
+ * .
+ *
+ * @param x
+ * the char to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(char x) throws IOException;
/**
- * Print an integer and then terminate the line. This method behaves as
+ * Print an integer and then terminate the line. This method behaves as
* though it invokes {@link #print(int)} and then {@link
- * #println()}.
- *
- * @param x the int to write
- * @throws java.io.IOException If an error occurred while writing
+ * #println()}
+ * .
+ *
+ * @param x
+ * the int to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(int x) throws IOException;
/**
- * Print a long integer and then terminate the line. This method behaves
- * as though it invokes {@link #print(long)} and then
+ * Print a long integer and then terminate the line. This method behaves as
+ * though it invokes {@link #print(long)} and then
* {@link #println()}.
- *
- * @param x the long to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the long to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(long x) throws IOException;
/**
- * Print a floating-point number and then terminate the line. This method
+ * Print a floating-point number and then terminate the line. This method
* behaves as though it invokes {@link #print(float)} and then
* {@link #println()}.
- *
- * @param x the float to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the float to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(float x) throws IOException;
/**
* Print a double-precision floating-point number and then terminate the
- * line. This method behaves as though it invokes {@link
- * #print(double)} and then {@link #println()}.
- *
- * @param x the double to write
- * @throws java.io.IOException If an error occurred while writing
+ * line. This method behaves as though it invokes {@link
+ * #print(double)} and
+ * then {@link #println()}.
+ *
+ * @param x
+ * the double to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(double x) throws IOException;
/**
- * Print an array of characters and then terminate the line. This method
+ * Print an array of characters and then terminate the line. This method
* behaves as though it invokes print(char[]) and then
* println().
- *
- * @param x the char[] to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the char[] to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(char x[]) throws IOException;
/**
- * Print a String and then terminate the line. This method behaves as
- * though it invokes {@link #print(String)} and then
+ * Print a String and then terminate the line. This method behaves as though
+ * it invokes {@link #print(String)} and then
* {@link #println()}.
- *
- * @param x the String to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the String to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(String x) throws IOException;
/**
- * Print an Object and then terminate the line. This method behaves as
+ * Print an Object and then terminate the line. This method behaves as
* though it invokes {@link #print(Object)} and then
* {@link #println()}.
- *
- * @param x the Object to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the Object to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(Object x) throws IOException;
-
/**
- * Clear the contents of the buffer. If the buffer has been already
- * been flushed then the clear operation shall throw an IOException
- * to signal the fact that some data has already been irrevocably
- * written to the client response stream.
- *
- * @throws IOException If an I/O error occurs
+ * Clear the contents of the buffer. If the buffer has been already been
+ * flushed then the clear operation shall throw an IOException to signal the
+ * fact that some data has already been irrevocably written to the client
+ * response stream.
+ *
+ * @throws IOException
+ * If an I/O error occurs
*/
-
abstract public void clear() throws IOException;
/**
- * Clears the current contents of the buffer. Unlike clear(), this
- * method will not throw an IOException if the buffer has already been
- * flushed. It merely clears the current content of the buffer and
- * returns.
- *
- * @throws IOException If an I/O error occurs
+ * Clears the current contents of the buffer. Unlike clear(), this method
+ * will not throw an IOException if the buffer has already been flushed. It
+ * merely clears the current content of the buffer and returns.
+ *
+ * @throws IOException
+ * If an I/O error occurs
*/
-
abstract public void clearBuffer() throws IOException;
/**
- * Flush the stream. If the stream has saved any characters from the
- * various write() methods in a buffer, write them immediately to their
- * intended destination. Then, if that destination is another character or
- * byte stream, flush it. Thus one flush() invocation will flush all the
- * buffers in a chain of Writers and OutputStreams.
+ * Flush the stream. If the stream has saved any characters from the various
+ * write() methods in a buffer, write them immediately to their intended
+ * destination. Then, if that destination is another character or byte
+ * stream, flush it. Thus one flush() invocation will flush all the buffers
+ * in a chain of Writers and OutputStreams.
*
* The method may be invoked indirectly if the buffer size is exceeded. *
- * Once a stream has been closed, - * further write() or flush() invocations will cause an IOException to be - * thrown. - * - * @exception IOException If an I/O error occurs + * Once a stream has been closed, further write() or flush() invocations + * will cause an IOException to be thrown. + * + * @exception IOException + * If an I/O error occurs */ - @Override abstract public void flush() throws IOException; /** * Close the stream, flushing it first. *
- * This method needs not be invoked explicitly for the initial JspWriter - * as the code generated by the JSP container will automatically - * include a call to close(). + * This method needs not be invoked explicitly for the initial JspWriter as + * the code generated by the JSP container will automatically include a call + * to close(). *
* Closing a previously-closed stream, unlike flush(), has no effect. - * - * @exception IOException If an I/O error occurs + * + * @exception IOException + * If an I/O error occurs */ - @Override abstract public void close() throws IOException; /** * This method returns the size of the buffer used by the JspWriter. - * + * * @return the size of the buffer in bytes, or 0 is unbuffered. */ - - public int getBufferSize() { return bufferSize; } + public int getBufferSize() { + return bufferSize; + } /** * This method returns the number of unused bytes in the buffer. - * + * * @return the number of bytes unused in the buffer */ - abstract public int getRemaining(); /** * This method indicates whether the JspWriter is autoFlushing. - * - * @return if this JspWriter is auto flushing or throwing IOExceptions - * on buffer overflow conditions + * + * @return if this JspWriter is auto flushing or throwing IOExceptions on + * buffer overflow conditions */ - - public boolean isAutoFlush() { return autoFlush; } + public boolean isAutoFlush() { + return autoFlush; + } /* * fields @@ -436,8 +449,8 @@ abstract public class JspWriter extends java.io.Writer { /** * The size of the buffer used by the JspWriter. */ - protected int bufferSize; - + protected int bufferSize; + /** * Whether the JspWriter is autoflushing. */ diff --git a/java/javax/servlet/jsp/SkipPageException.java b/java/javax/servlet/jsp/SkipPageException.java index 8dfcc1366..1ed632dd9 100644 --- a/java/javax/servlet/jsp/SkipPageException.java +++ b/java/javax/servlet/jsp/SkipPageException.java @@ -1,76 +1,75 @@ /* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 page in 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 + * 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 page in 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. + * 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 -{ +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 + * + * @param message + * the detail message */ - public SkipPageException( String message ) { - super( 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 + * + * @param message + * the detail message + * @param rootCause + * the originating cause of this exception */ - public SkipPageException( String message, Throwable rootCause ) { - super( message, rootCause ); + 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 + * + * @param rootCause + * the originating cause of this exception */ - public SkipPageException( Throwable rootCause ) { - super( rootCause ); + public SkipPageException(Throwable rootCause) { + super(rootCause); } - } - - diff --git a/java/javax/servlet/jsp/el/ExpressionEvaluator.java b/java/javax/servlet/jsp/el/ExpressionEvaluator.java index 332a9f537..6610fcb6b 100644 --- a/java/javax/servlet/jsp/el/ExpressionEvaluator.java +++ b/java/javax/servlet/jsp/el/ExpressionEvaluator.java @@ -1,111 +1,115 @@ /* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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; - /** - *
The abstract base class for an expression-language evaluator. - * Classes that implement an expression language expose their functionality - * via this abstract class.
- * - *An instance of the ExpressionEvaluator can be obtained via the - * JspContext / PageContext
- * - *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.
- * - *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 "abc${1+1}def${1+1}ghi" or even
- * "${1+1}${1+1}" will cause an ELException to
- * be thrown.
The following are examples of syntactically legal EL expressions: - * + *
+ * The abstract base class for an expression-language evaluator. Classes that + * implement an expression language expose their functionality via this abstract + * class. + *
+ *+ * An instance of the ExpressionEvaluator can be obtained via the JspContext / + * PageContext + *
+ *+ * 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. + *
+ *
+ * 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 "
+ * abc${1+1}def${1+1}ghi" or even "${1+1}${1+1}" will
+ * cause an ELException to be thrown.
+ *
+ * The following are examples of syntactically legal EL expressions: *
${person.lastName}${8 * 8}${my:reverse('hello')}${person.lastName}${8 * 8}${my:reverse('hello')}parseExpression(). The
- * Expression object returned must invoke the same
- * functions regardless of whether the mappings in the
- * provided FunctionMapper instance change between
- * calling ExpressionEvaluator.parseExpression()
- * and Expression.evaluate().
+ * 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
+ * parseExpression(). The Expression
+ * object returned must invoke the same functions regardless of
+ * whether the mappings in the provided
+ * FunctionMapper instance change between calling
+ * ExpressionEvaluator.parseExpression() and
+ * Expression.evaluate().
* @return The Expression object encapsulating the arguments.
- *
- * @exception ELException Thrown if parsing errors were found.
- */
- public abstract Expression parseExpression( String expression,
- @SuppressWarnings("unchecked") // TCK signature fails with generics
- Class expectedType,
- FunctionMapper fMapper)
- throws ELException;
-
+ * @exception ELException
+ * Thrown if parsing errors were found.
+ */
+ public abstract Expression parseExpression(String expression,
+ @SuppressWarnings("unchecked")// TCK signature fails with generics
+ 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.
+ /**
+ * 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.
+ * @exception ELException
+ * Thrown if the expression evaluation failed.
*/
- public abstract Object evaluate( String expression,
- @SuppressWarnings("unchecked") // TCK signature fails with generics
- Class expectedType,
- VariableResolver vResolver,
- FunctionMapper fMapper)
- throws ELException;
+ public abstract Object evaluate(
+ String expression,
+ @SuppressWarnings("unchecked")// TCK signature fails with generics
+ Class expectedType, VariableResolver vResolver,
+ FunctionMapper fMapper) throws ELException;
}
-
diff --git a/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java b/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java
index d2d38ecdc..de7fe39bf 100644
--- a/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java
+++ b/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java
@@ -1,20 +1,19 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You 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.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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;
import java.beans.FeatureDescriptor;
@@ -33,166 +32,167 @@ import javax.servlet.jsp.PageContext;
public class ScopedAttributeELResolver extends ELResolver {
- public ScopedAttributeELResolver() {
- super();
- }
+ public ScopedAttributeELResolver() {
+ super();
+ }
- @Override
+ @Override
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;
- }
-
- @Override
+ 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;
+ }
+
+ @Override
public Class