This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
ThanQ Frank but im asking. can we keep more than one ServletContext in a servlet container
Joined: Jan 07, 1999
yes. That's what I wass trying to explain. A servlet container holds separate "applications", and each such application has its own servlet context. If you want more than one "context" in a single application, one way is to put a Map in the application context for each "sub context", and store your different objects in there. Or have I misunderstood what you are asking?
Basically, for each .WAR file deployed, the server creates/manages one ServletContext. ServletContext is an interface with the implementing class provided by the container. You should not try to create one yourself. If you need a place to store other information within a web application, utilize something like Frank has outlined and store it in the one and only ServletContext your app should reference.