Be careful though using patterns (eg Singleton) that utilise class scope (ie statics)
in a servlet engine.
The class scope is exposed to everything in that instance of the JVM, whereas a single
JVM can host multiple web applications.
So, if you do end up wanting to host two different instances of your web app (in
different contexts) in the same JVM, then you're going to have problems if your using
a Singleton.
If you want some configuration accessible to all servlets (etc) in a particular web
application (I think that's what you're looking for) then it's probably better to use
the ServletContext as a dumping ground for your shared stuff.
That's my 2p anyway.
> You don't need to rely on the servlet engine for this, and you certainly
> don't need to hard-code these values in any of your classes. You should
> implement a singleton design pattern "properties" class that loads
> itself with information from a .properties file -- a fairly simple
> wrapper around java.util.PropertyResourceBundle.
===========================================================================
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