I have run into the situation where I want one custom tag to include the
behaivior of another.
I could solve this problem by using
<tags:one>
<tags:two id="x" />
</tags:one>
But since I always want to include the behaviour - and not least the
output - of the inner tag I wanted to include that inside the outer tag. So
I wrote code looking something like this:
public class One extends TagSupport
{
public int doStartTag() throws JspException
{
// Some code and ouput
Two two = new Two();
two.setPageContext(pageContext);
two.setParent(this);
two.setId("x");
two.doStartTag();
two.doEndTag();
two.release();
// More code and output
return EVAL_PAGE;
}
}
My question is simply: Is this bad design?
Mattias Jiderhamn
Expert Systems
[EMAIL PROTECTED]
http://www.expertsystem.se
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com