package com.itheima.domain;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.IterationTag;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
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;
}
}
}
|
|