You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ak...@hyperreal.org on 1999/10/14 06:05:18 UTC
cvs commit: jakarta-tomcat/src/share/javax/servlet/jsp/tagext BodyContent.java Tag.java BodyJspWriter.java
akv 99/10/13 21:05:18
Modified: src/share/javax/servlet/jsp JspWriter.java PageContext.java
src/share/javax/servlet/jsp/tagext Tag.java
Added: src/share/javax/servlet/jsp/tagext BodyContent.java
Removed: src/share/javax/servlet/jsp/tagext BodyJspWriter.java
Log:
From the JSP 1.1 PR2 spec:
These are just the changes to
(a) check in a newer (hopefully better) version of an implementation
for BodyContent (previously known as BodyJspWriter).
(b) make the name change from BodyJspWriter to BodyContent.
Revision Changes Path
1.2 +7 -1 jakarta-tomcat/src/share/javax/servlet/jsp/JspWriter.java
Index: JspWriter.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/javax/servlet/jsp/JspWriter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JspWriter.java 1999/10/09 00:20:31 1.1
+++ JspWriter.java 1999/10/14 04:05:16 1.2
@@ -1,5 +1,5 @@
/*
- * @(#)JspWriter.java 1.8 99/05/30
+ * @(#)JspWriter.java 1.10 99/10/08
*
* Copyright (c) 1999 Sun Microsystems, Inc. All Rights Reserved.
*
@@ -58,6 +58,12 @@
*/
public static final int DEFAULT_BUFFER = -1;
+
+ /**
+ * constant indicating that the Writer is buffered and is unbounded; this is used in BodyContent
+ */
+
+ public static final int UNBOUNDED_BUFFER = -2;
/**
* protected constructor.
1.2 +5 -5 jakarta-tomcat/src/share/javax/servlet/jsp/PageContext.java
Index: PageContext.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/javax/servlet/jsp/PageContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PageContext.java 1999/10/09 00:20:31 1.1
+++ PageContext.java 1999/10/14 04:05:16 1.2
@@ -1,5 +1,5 @@
/*
- * @(#)PageContext.java 1.19 99/08/09
+ * @(#)PageContext.java 1.21 99/10/07
*
* Copyright (c) 1999 Sun Microsystems, Inc. All Rights Reserved.
*
@@ -35,7 +35,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.tagext.BodyJspWriter;
+import javax.servlet.jsp.tagext.BodyContent;
/**
* <p>
@@ -467,14 +467,14 @@
abstract public void handlePageException(Exception e) throws ServletException, IOException;
/**
- * Return a new BodyJspWriter object, save the current "out" JspWriter,
+ * 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 BodyJspWriter
+ * @return the new BodyContent
*/
- public BodyJspWriter pushBody() {
+ public BodyContent pushBody() {
return null; // XXX to implement
}
1.2 +6 -6 jakarta-tomcat/src/share/javax/servlet/jsp/tagext/Tag.java
Index: Tag.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/javax/servlet/jsp/tagext/Tag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Tag.java 1999/10/09 00:20:32 1.1
+++ Tag.java 1999/10/14 04:05:17 1.2
@@ -206,15 +206,15 @@
// Actions related to body evaluation
/**
- * Set the BodyJspWriter.
+ * Set the BodyContent.
* It will be invoked at most once per action invocation.
* Will not be invoked if there is no body evaluation.
*
* Frequently it is not redefined by Tag author.
*
- * @param b the BodyJspWriter
+ * @param b the BodyContent
*/
- public void setBodyOut(BodyJspWriter b) {
+ public void setBodyOut(BodyContent b) {
this.bodyOut = b;
}
@@ -344,7 +344,7 @@
/**
* @return the value of the "out" JspWriter prior to pushing
- * a BodyJspWriter
+ * a BodyContent
*/
protected final JspWriter getPreviousOut() {
@@ -355,7 +355,7 @@
* @return the value of the current "out" JspWriter
*/
- protected final BodyJspWriter getBodyOut() {
+ protected final BodyContent getBodyOut() {
return bodyOut;
}
@@ -370,7 +370,7 @@
private Hashtable values;
// protected fields
- protected BodyJspWriter bodyOut;
+ protected BodyContent bodyOut;
protected PageContext pageContext;
protected TagData tagData;
}
1.1 jakarta-tomcat/src/share/javax/servlet/jsp/tagext/BodyContent.java
Index: BodyContent.java
===================================================================
/*
* @(#)BodyContent.java 1.12 99/10/08
*
* Copyright (c) 1999 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
* CopyrightVersion 1.0
*/
package javax.servlet.jsp.tagext;
import java.io.Reader;
import java.io.Writer;
import java.io.IOException;
import javax.servlet.jsp.*;
/**
* A JspWriter subclass that can be used to process body evaluations
* so they can re-extracted later on.
*/
public abstract class BodyContent extends JspWriter {
/**
* Protected constructor.
*
* Unbounded buffer, no autoflushing.
*/
protected BodyContent(JspWriter e) {
super(UNBOUNDED_BUFFER , false);
this.enclosingWriter = e;
}
/**
* Redefine flush().
* It is not valid to flush.
*/
public void flush() throws IOException {
throw new IOException("Illegal to flush within a custom tag");
}
/**
* Clear the body.
*/
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.
* Note: this is after evaluation!! There are no scriptlets,
* etc in this stream.
*
* @returns the value of this BodyContent as a Reader
*/
public abstract Reader getReader();
/**
* Return the value of the BodyContent as a String.
* Note: this is after evaluation!! There are no scriptlets,
* etc in this stream.
*
* @returns the value of the BodyContent as a String
*/
public abstract String getString();
/**
* Write the contents of this BodyContent into a Writer.
* Subclasses are likely to do interesting things with the
* implementation so some things are extra efficient.
*
* @param out The writer into which to place the contents of
* this body evaluation
*/
public abstract void writeOut(Writer out);
/**
* Get the enclosing JspWriter
*
* @returns the enclosing JspWriter passed at construction time
*/
public JspWriter getEnclosingWriter() {
return enclosingWriter;
}
/**
* private fields
*/
private JspWriter enclosingWriter;
}