out.print( "输出" );
out.write(""r"n</body>"r"n</head>"r"n</html>"r"n");
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); }
}
}
从上面的代码中可以清晰的看到JSP内建的几个对象(out、request、response、session、pageContext、application、config、page)是怎么产生的,懂servlet的朋友一看就能明白。
下面重点理解一下out对象,它被声明为JspWriter类型,JspWriter是一个抽象类,在包javax.servlet.jsp中可以找到它的定义。
abstract public class javax.servlet.jsp.JspWriter extends java.io.Writer{
final public static int NO_BUFFER = 0;
final public static int DEFAULT_BUFFER = -1;
final public static int UNBOUNDED_BUFFER = -2;
protected int bufferSize;
protected Boolean autoFlush;
protected javax.servlet.jsp.JspWriter(int arg1, boolean arg2);
abstract public void newLine() throws IOException ;
abstract public void print(boolean arg0) throws IOException ;
abstract public void print(char arg0) throws IOException ;
abstract public void print(int arg0) throws IOException ;
abstract public void print(long arg0) throws IOException ;
abstract public void print(float arg0) throws IOException ;
abstract public void print(double arg0) throws IOException ;
abstract public void print(char<> arg0) throws IOException ;
abstract public void print(String arg0) throws IOException ;
abstract public void print(Object arg0) throws IOException ;
abstract public void println() throws IOException ;
abstract public void println(boolean arg0) throws IOException ;
abstract public void println(char arg0) throws IOException ;
abstract public void println(int arg0) throws IOException ;
abstract public void println(long arg0) throws IOException ;
abstract public void println(float arg0) throws IOException ;
abstract public void println(double arg0) throws IOException ;
abstract public void println(char<> arg0) throws IOException ;
abstract public void println(String arg0) throws IOException ;
abtract public void println(Object arg0) throws IOException ;
abstract public void clear() throws IOException ;
JspWriter与PrintWriter的关系_IT/计算机_专业资料。比较详细一.JspWriter 与 PrintWriter 的关系: 1.都是继承自 java.io.Writer 类. JspWriter 可以在 JSP 页面...
PrintWriter类入门_计算机软件及应用_IT/计算机_专业资料。PrintWriter类入门1、PrintWriter 类(java.io 包中) PrintWriter 是一个非常实用的输出流。 (1) 构造...
您可以使用page指令元素的autoFlush来设定JSP页面是否使用缓冲区自动清出功能,out(JspWriter)以一种方式与 HttpServletResponse的PrintWriter建立关系,两者之间的行为...
处理中出现的异常 JspWriter类 JspWriter类 JspWriter类与PrintWriter类作用类似,主要用 JspWriter类与 类与PrintWriter类作用类似 类作用类似, 区别在于处理JSP缓冲区 ...
JSP与Servlet的关系 JSP语法简单,可以方便地嵌入HTML之中,很容易加入动态 的部分...为了使response对象更有用,JspWriter是具有 缓存的PrintWriter。注意,可以通过指令...
? ? ? Tip:JSP九大隐式对象对应关系 ? ? ? ? ? ? ? ? ? request ...JspWriter相当于 一种带缓存功能的PrintWriter,设置JSP页面的page指令的 buffer...
下一步求值此标签体,但如果说明了SKIP_BODY 域常量则跳过 调用setBodyContent()方法,把此标签的输出 存储到称为JspWriter一个特殊的PrintWriter 下一步调用doAfter(...
为了让response对象更为实用,out是带缓存功能 的PrintWriter,即JspWriter。 JSP允许通过page指令的buffer属性调整缓存的大 小,甚至允许关闭缓存。 out一般只在Script...
out是带缓存功能的PrintWriter,即JspWriter。 JSP允许通过page指令的buffer属性调整缓存的大小, 甚至允许关闭缓存。 ? out一般只在Scriptlet内使用,这是因为JSP表达式...
热门文档