public class Demo3Tag extends TagSupport {
private int i=3;
public int doStartTag() throws JspException {
return Tag.EVAL_BODY_INCLUDE;
}
public int doAfterBody() throws JspException {
if(i-->1){
return IterationTag.EVAL_BODY_AGAIN;
}
else{
i=3;
return Tag.SKIP_BODY;
}
}