On 28 Jul 2002, David M. Karr wrote:

> Date: 28 Jul 2002 10:11:55 -0700
> From: David M. Karr <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Tags: write private "init()" method to init. vars from cons. and
>     release
>
> Is there some reason the Struts custom tags have redundant initializations of
> their instance variables, once as implicit initializations, and once in the
> "release()" method?  I hope that this code is either generated, or someone has
> carefully examined every single one to verify that the implicit init. value is
> identical to the value it's set to in "release()".
>
> It would seem to me that a better strategy would be to write a private "init()"
> method which initializes all the instance variables to their initial state, and
> which is called from the "release()" method and a new no-args constructor (I
> would guess that none of the tags have a defined constructor).
>
> Is there a good reason for how this currently works?
>

It actually turns out that initializing to non-null values tends to get
you in trouble in containers that recycle tag instances -- we really need
to go through and rip that out (as well as the tendency to modify the
specified attribute values during doStartTag() or doEndTag(), which will
cause nothing but grief with optimizing page compilers.

Craig


> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> [EMAIL PROTECTED]
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to