FileDocCategorySizeDatePackage
RepeatSimpleTag.javaAPI DocApache Tomcat 6.0.141437Fri Jul 20 04:20:36 BST 2007jsp2.examples.simpletag

RepeatSimpleTag

public class RepeatSimpleTag extends javax.servlet.jsp.tagext.SimpleTagSupport
SimpleTag handler that accepts a num attribute and invokes its body 'num' times.

Fields Summary
private int
num
Constructors Summary
Methods Summary
public voiddoTag()

        for (int i=0; i<num; i++) {
            getJspContext().setAttribute("count", String.valueOf( i + 1 ) );
	    getJspBody().invoke(null);
        }
    
public voidsetNum(int num)

	this.num = num;