Posted on 2006-07-15
I'm new to J2EE (Servlets and JSP's).
The question is really dumb :
What is the best way to intialize the whole system :
I mean I have a DAO package,
controller package that contains my servlet,
business package, ...
(I use MVC)
and I would like to initialize objects when I deploy my app in Tomcat.
I am used to develop apps with Swing and I had a Main class
that intiated the objects that needed to be initialized at start.
Then later these objects could be used.
But I am a bit confused here.
For example a user want to search other users in the system.
I don't want to wait a first user connects the Servlet and asks this service to finally load all the users from my DB in the app.
I want to load the users in my app at the moment I deploy my app in Tomcat.