I just noticed some code in a doEndTag() which raised my eyebrows.
In J2EE, I understand that the container (implementation of the spec) can
pool session beans, and that this is configurable. ...likewise with
connection pools.
Everything else I had thought was either...(1) a static class (rather,
static methods in a class) which would have application scope (more than one
session can affect the same attributes, raising some coding considerations),
or...(2) an instance of a class, having - at the most - session scope via a
reference put in the session (unless explicitly given a reference in the
application scope).
The following code implies that the container (weblogic, in my case) might
decide to keep a tag handler instance for reuse by other sessions, or at
least by my session once again (not sure if the former).
If the former, that would seem to put the responsibility on the developer to
'clean up' or null-out attributes before being done, and even synchronize
the scope from doStartTag() through doEndTag(). If the later, puts the same
responsibility on the developer (apparently), but of course there is no
concurrence concern.
Any input on this? I had never heard of this before. (...assuming the
logic was placed there by someone correctly understanding the container
capability/discretion to reuse an instance...)
Thanks,
John Mitchell
public int doEndTag() throws JspException {
//reinit properties in case tag instance reused by container
crudOperation = null;
crudOperationBean = null;
[ ...etc. ]
users@xxxxxxxxxx
**********************************************************************
The content of this e-mail message and any attachments are confidential and
may be legally privileged, intended solely for the addressee. If you are not
the intended recipient, be advised that any use, dissemination,
distribution, or copying of this e-mail is strictly prohibited. If you
receive this message in error, please notify the sender immediately by reply
email and destroy the message and its attachments.
**********************************************************************