j2ee: The SimpleTag Interface [10/27] ![]() ![]() ![]() |
doTag()
- Called by the container to invoke this tag,
and is called once and only once. The lifecycle for SimpleTag is
simpler than Tag, IterationTag,
or BodyTag.
Lifecycle:
setJspContext()
and setParent()
methods are called by the container. The setParent()
method is only called if the element is nested within another
tag invocation.
setJspBody()
method is called
by the container to set the body of this tag, as a JspFragment.
If the action element is empty in the page, this method is not
called at all.
doTag()
method is called by the container. All
tag logic, iteration, body evaluations, etc. occur in this method.
doTag()
method returns and all variables are synchronized.
If you need to create a SimpleTag
, but use it as a
classic tag, you can use a TagApapter
to wrap the
SimpleTag
and then the SimpleTag can be used where a classic
Tag
is expected.