[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

J2EE

Hi,

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.

Thank you.
0
matthew016
Asked:
matthew016
  • 2
1 Solution
 
CEHJCommented:
Use an initialization servlet to load them at startup

http://www.codestyle.org/java/servers/FAQ.shtml#loadonstartup
0
 
matthew016Author Commented:
Thank you for being always so helpful.
I posted a new question, if u can help ...
Thank you.
0
 
CEHJCommented:
:-)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now