传统自定义标签实现方法
public class ViewSomeTag extends TagSupport {
public int doStartTag() throws JspException {
// TODO Auto-generated method stub
return Tag.EVAL_BODY_INCLUDE;
}
}
public int doStartTag() throws JspException {
// TODO Auto-generated method stub
return Tag.EVAL_BODY_INCLUDE;
}
}
简单自定义标签实现方法
public class SimpleTagViewSomeTag extends SimpleTagSupport {
/*
* 控制标签体是否执行,在doTag()内如果什么都不写则页面没内容输出
* */
public void doTag() throws JspException, IOException {
JspFragment jf=this.getJspBody();
jf.invoke(this.getJspContext().getOut());
super.doTag();
}
}
/*
* 控制标签体是否执行,在doTag()内如果什么都不写则页面没内容输出
* */
public void doTag() throws JspException, IOException {
JspFragment jf=this.getJspBody();
jf.invoke(this.getJspContext().getOut());
super.doTag();
}
}