Simple solution
Make a class and put this in your web.xml
<
servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>mypackage.MyClass</servlet-class>
<init-param>
<param-name>myds</param-name>
<param-value>jdbc/MyDS</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>
Note the load-on-startup tag which tells the server, the priority loading order of this servlet. In the init of this class, you can load your objects and store them in some context avl to all applications (appcontext).
I have this set up on both wl8 and tomcat4.1
Sahil