Easy question first:  If you don't need BodyTag, don't use it, since it is a
potential memory hog.  If you need to process it in a loop, use IterationTag
instead. (of course this assumes TC 4.x or higher)

Hard question last:  Without seeing your JSP page, I can't tell you exactly
why Jasper chooses to create two methods.  However, popular candidates are:
1) The different calls to 'msgtag' specify different attributes sets.
2) One or more of the 'msgtag' invocations  is nested within the body of
another Tag.

The reason to use method-calls is to (try) and prevent any single method in
the resulting .class from exceding 64K (at which point javac pucks :).

"Antony Paul" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>   I wrote two custom tags. One is used only once in the page(msgtag) while
> the other one is used multiple times(outtag) similar to JSTL c:out. Both
> classes extends BodyTagSupport. When I looked at the compiled servlet code
> both tags are called in different ways. Each use of msgtag is made a
method
> call. If I put 2 msgtag(both are exacly same) in JSP it creates 2 methods.
> outtag is invoked directly in servlet.
> Why the difference ?.
> Is this behavior can be controlled through coding ?.
> Which one is better ?.
> Why Tomcat is creating one method per each tag invocation.? Why not manage
> it like an object. Each time it is getting an instance from a pool ?
>
> BTW Extending TagSupport or BodyTagSupport is better. I have no need to
> process the body ? Any performance gain ?
>
> rgds
> Antony Paul




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to