I am in process of developing a Java application (war) which will be deployed in an Application Server like jBoss, WebSphere, WebLogic and Glassfish. Within my code I am getting an instance of a class which is 'static', now If I deploy two instances of the same application, both will end up using same static instance rather than different. Is there anyway I can have only one instance of a class for each separately deployed application without using 'static' property. I heard about this 'Context Classloading Stuff' but couldn't grasp the idea. Can anyone explain or refer me to the good article about it. Also, I am looking for an example, seems like its all about configuration of my application at deployment time but how?
I am quite new to java so please accept my apology if I am talking nonsense.