as we know static accessors are used to check the number of instance to one
and also global copy for all objects of the class.
But when the program enters environment where you have different class
loaders. .like web application servers its bit tricky and I have faced
problems in JRun 4.

So its always better to manage this restrictions in our code uring Singleton
pattern.

Cheers.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED] Behalf Of Partha Ranjan Das
Sent: Wednesday, September 17, 2003 10:57 AM
To: [EMAIL PROTECTED]
Subject: Re: using static properties vs. servletcontext for storing
applic atio n scope objects


Could any of you shed light on this? If somebody could give the fundamental
differences of the two approaches, it is even better.

Regards,
Partha

-----Original Message-----
From: Partha Ranjan Das [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 6:46 PM
To: [EMAIL PROTECTED]
Subject: using static properties vs. servletcontext for storing
applicatio n scope objects


Hi all,

I have to store a Java object into an application scope. I am to decide
between two possible implementations viz.:

1. use a class with some static properties and some static accessor methods
which can be accessed by any JSP/servlet thread. The shared (application )
object will be there in the static property and will be accessed by the
static methods.

2. use ServletContext's getAttribute() and setAttribute() methods.

I want to know which method is a better approach for a web site with
possibly 3000 concurrent users?

Thanks in advance.

Regards,
Partha
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to