Moment the main servlet is deployed, it needs to perform calculations and prepare a list. this list needs to be accessed by the other servlet which are called subsequently. the calculation needs to run only once. could some one please explain how to go about doing that.
thanks
You can use a
ServletContextListenerand perform calculation from there.The class file :
web.xml :
Alternatively, instead of that entry in web.xml file, you can annotate your
ServletContextListenerclass with@WebListenerin later versions of the Servlet spec. The Servlet container will automatically detect, load, and execute your listener class.Resources :