I have a class that takes a bit of time to start up (makes some JNI calls and what not), so it is not feasable to initialize this class everytime a page loads. Is it possibl
If you want it to happen once for the whole app, and happen before any servlet is run, implement ServletContextListener and put your startup code in contextInitialized(). Then set up your web.xml to specify your class as a listener.
Otherwise, you can do what the other answer says and put it in the init() method of the servlet.