/**
 * A Tag Handler written from scratch without extending TagSupport
 * Takes one attribute: att
 */

package tags;

import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;

public class BTag implements BodyTag {
    // Property Attributes
    public void setAtt(String s) {
	att = s;
    }

    public String getAtt() {
	return att;
    }

    // Setters for standard tag handler attributes

    public void setPageContext(PageContext pc) {
	this.pc = pc;
    }
       
    public void setParent(Tag p) {
	this.parent = p;
    }

    public Tag getParent() {
	return parent;
    }

    // The action methods

    public int doStartTag() {
	return EVAL_BODY_TAG;
    }

    public void setBodyContent(BodyContent b) {
	BodyContent body = b;
    }

    public void doInitBody() {
    }

    public int doAfterBody() {
	try {
	    body.writeOut(pc.getOut());
	    body.clearBody();
	} catch (Exception ex) {
	    // ignore
	}
	return SKIP_BODY;
    }

    public int doEndTag() {
	return EVAL_PAGE;
    }

    public void release() {
    }

    // ======
    private String att = null;
    private PageContext pc = null;
    private Tag parent = null;
    private BodyContent body = null;
}
