I share the same stylistic / pragmatic view as Hans.
One example where <%! does not introduce this problem is when it is used
to define methods used elsewhere in the JSP page. I personally would
tend to do this by defining objects (introduced via a custom tag) and
invoking methods on them, but that is style.
- eduard/o
> Date: Sun, 23 Jan 2000 13:07:57 -0800
> From: Hans Bergsten <[EMAIL PROTECTED]>
> Subject: Re: important for all jsp developers
>
>
> My general advice is, don't use <%! %> at all. It creates exactly the
> multi-threading
> problem you describe.
>
> If the value is only needed during processing of one request, and depending on how
> the value is used, use scriptlets to declare the variable as a local variable
> or beans with page or request scope.
>
> If the value must be available across requests, use session scope, or application
> scope if it must also be available to other clients. But with session and
> application scope you need to consider multi-threading issues again.
>
> 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