FileDocCategorySizeDatePackage
FooTag.javaAPI DocApache Tomcat 6.0.142260Fri Jul 20 04:20:32 BST 2007examples

FooTag

public class FooTag extends ExampleTagBase
Example1: the simplest tag Collect attributes and call into some actions

Fields Summary
private String[]
atts
int
i
Constructors Summary
Methods Summary
public intdoAfterBody()

        try {
            if (i == 3) {
                bodyOut.writeOut(bodyOut.getEnclosingWriter());
                return SKIP_BODY;
            } else
                pageContext.setAttribute("member", atts[i]);
            i++;
            return EVAL_BODY_BUFFERED;
        } catch (IOException ex) {
            throw new JspTagException(ex.toString());
        }
    
public voiddoInitBody()

        pageContext.setAttribute("member", atts[i]);
        i++;
    
public intdoStartTag()
Process start tag

return
EVAL_BODY_INCLUDE

        i = 0;
	return EVAL_BODY_BUFFERED;
    
private final voidsetAtt(int index, java.lang.String value)

    
           
        atts[index] = value;
    
public voidsetAtt1(java.lang.String value)

        setAtt(0, value);
    
public voidsetAtt2(java.lang.String value)

        setAtt(1, value);
    
public voidsetAtt3(java.lang.String value)

        setAtt(2, value);