tags:

views:

40

answers:

0

In relation to Custom Tags in JSP 2.1 (Java EE 5): I understand that to faciliate nesting, a classic BodyTagSupport can pipe the output of the body from its buffer to its parent tag's writer, e.g.

BodyContent bc = getBodyContent();
bc.writeOut(bc.getEnclosingWriter());

However, is there an equivalent technique for the simpler TagSupport, e.g. if you want to write something in doStartTag(). I'm only aware of getPageContext().getOut().write(), but won't this write directly to the top-level page writer? What if you want to cater for the possibility that your TagSupport tag is nested in the body of another tag, which might ultimately decide to manipulate the inner tag's output?