日期:2014-05-18  浏览次数:20626 次

自定义标签的问题
public int doEndTag() throws JspException {

//JspWriter out = bodyContent.getEnclosingWriter();
JspWriter out = pageContext.getOut();
 
try {
out.print(bodyContent.getString());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
 

return this.EVAL_PAGE;
}

上面的代码中 有两种方式都可以获得out 对象 并能在页面上显示 不知道有什么区别?

------解决方案--------------------
有content的时候不就有区别了,一个在content之前执行,一个在content之后执行。
光是看方法名也可以猜出来啊