On Sat, 28 Aug 2004 11:47:14 +1200, Jason Lea <[EMAIL PROTECTED]> wrote:
> Tomcat 5 includes *"JSP Custom Tag Pooling* - The java objects
> instantiated for JSP Custom Tags can now be pooled and reused. This
> significantly boosts the performance of JSP pages which use custom tags."
> 

This is true for "classic" tag handlers ... i.e. those that conform to
the JSP 1.1 or 1.2 APIs, but not for JSP 2.0 tag handlers.

> I seem to remember reading somewhere (can't remember where, does someone
> have a link) that JSPs that don't have scriptlets can have the taglib
> pooled.  I assume this means the taglib is loaded and shared amongst
> each JSP that uses them, speeding up the page and reducing memory.   I
> guess a scriplet on a page may make the web server make a local copy?
> 

The pooling being discussed isn't related to the tag *classes* (which
would depend on where you put the JAR containing them -- tag classes
in common/lib or shared/lib are indeed shared), but the tag
*instances* themselves.  In the early days of JSP (or, more properly,
in the days of the JVMs that were available in the early days of JSP)
object creation was more expensive than it is today, so there was a
desire to allow the same tag instance to be used if the same tag, with
the same set of defined attributes (although not necessarily the same
values) was used more than once.  In practice, this didn't help much
-- especially now, when object creation is much cheaper -- and
complicated the design of tag classes because the author had to deal
with some extra restrictions.

For JSP 2.0's "SimpleTag" API, the tag handler developer does not have
to worry about instance reuse.  You can do pretty much whatever you
need to and know that, when the JSP page is done with your tag, it'll
simply get garbage collected instead.

> I find with Tomcat 5+JSP 2.0 that writing pages with tags and EL has
> made them much easier to write and understand.  With being able to get
> rid of <c:out /> tags and just use ${var} everywhere makes them much
> easier to read.

That's yet another advantage of getting used to the EL syntax ... in
JSP 2.0 you can use it everywhere, not just in attributes of tags that
undertsand it.

    <p>Hello $name!</p>


> --
> Jason Lea
> 

Craig

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

Reply via email to