Another way is to invoke your
servlet during deployment, by having the <load-on-startup>. So you have your cache instantiation code in the servlet which is loaded on the startup of the server. Hope this helps.
This is an outdated technique that has potential problems.
If you have a container that supports servlet spec 2.3 or better, it makes sense to use the feature that were written specifically for this purpose.
[ June 25, 2007: Message edited by: Ben Souther ]