package mytag;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

public class InTag extends TagSupport
{

    private OutTag parent;

    public void setParent(Tag p)
    {
        parent=(OutTag)p;
    }

    public Tag getParent()
    {
        return parent;
    }

    public int doStartTag()throws JspTagException
    {
        return EVAL_BODY_INCLUDE;
    }

    public int doEndTag()throws JspTagException
    {
       try
       {
           this.pageContext.getOut().write(parent.getContent());
       }
       catch(Exception e)
       {
           throw new  JspTagException(e.getMessage());
       }
       release();
       return EVAL_PAGE;
    }
}
