Your question is a bit unclear. Objects cannot be invoked, though their
methods can be.
My best guess at what you mean is that you want one of your tag handlers
to invoke the life cycle methods of other tag handlers. Let me be very
clear: that is absolutely FORBIDDEN. Tag handlers' life cycle methods
are reserved for use by the JSP container. (And it wouldn't do what you
probably want, anyway.) If that was indeed what you were asking then do
not despair; you don't need to do it in the first place. Read on.
A tag handler can easily obtain a reference to any other tag handler
that logically contains it by use of TagSupport.findAncestorWithClass().
Via that reference, it can invoke any of the containing handler's
methods (but see above, and strong prohibitions also apply to attribute
You should also pay attention to the BodyTag interface. Chances are
good that the tag handlers you are working on will want to buffer their
bodies. I might design the system along these lines:
(1) [Architectural] The handler for myTab:Tabs provides a method
addTab([SomeAppropriateType]) that is intended for other tag handlers to use
(2) [Behavioral] The handler for myTab:Tabs buffers its body and
discards the result
(3) [Behavioral] The handler for myTab:Tab buffers its body, then in
doEndTag() it looks up the containing myTab:Tabs and invokes its
addTab() method to pass in the relevant information (including the
result of the body evaluation)
(4) [Behavioral] In its own doEndTag(), myTab:Tabs writes out
appropriate code based on all the data passed to its addTab() method
since the last doStartTag() invocation.
You really should read up on all of this in the JSP specification (my
choice) or a suitable reference book. Custom tags aren't that *** ce
you get the hang of them, but you can really bring trouble on yourself
if you don't follow all the details of the behavi *** contracts that
exist between tag handlers and their container.