Maneesha Jain wrote:
>
> Hi,
>
> In JSP 1.1, if I write a Tag <UnitOfWork>
>
> <UnitOfWork id = "1" >
> </UnitOfWork>
>
> <UnitOfWork id = "2">
> </UnitOfWork>
>
> How do I indicate to the JSP Engine, that it should a create a new instance
> of Tag Handler class "UnitOfWork" for 2nd instance and not use the first one ?
>
> (Or does it anyway does create a new instance of Tag Handler Class everytime it
> encounters its corresponding start tag ?)
If the tags (action elements) are nestled, code is generated to make sure a unique
instance is used to handle each occurrence. It doesn't necessarily mean that new
instances are created for each action, since the JSP container may use a pool of
instances to improve performance.
But in your example, the action elements are not nestled, so it shouldn't matter
if the same or different instances are used. A tag handler can not keep any local
state after the end tag anyway. If the tag handler creates some information that
needs to be available after the end tag, it should save the information as a
variable in an appropriate scope (page, request, session or application).
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html