Or, if your init method is not in a servlet class, you may want to have
your class implement the ServletContextListener interface. Then the
method contextInitialized() is your friend, it is called by tomcat for
each implementor upon initialization of your web app context, i.e. the
"startup" event o
is dealt with in other nontrivial apps.
The most important (and simple) lesson to learn probably is that if your
app once has committed data to the client, then it must find a clean
method of saying "Oops, sorry, there was a problem" *together* with the
already written data.
Any other