标签getBodyContent()输出为NULL,为什么
各路神仙帮忙看看,为什么会出现这样的问题
package com.tags;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.*;
public class Body
extends BodyTagSupport {
public int doStartTag() throws JspException {
System.out.println("f==" + getBodyContent());
return EVAL_BODY_TAG;
}
public int doEndTag() throws JspException {
return EVAL_PAGE;
}
}
输出f==null
test.jsp
...
<html:example2>
eeeeeeeeeeeeeeeee
</html:example2>
*.tld
<tag>
<name>example2</name>
<tagclass>com.tags.Body</tagclass>
<bodycontent>JSP</bodycontent>
</tag>