Solved

J2EE

Posted on 2006-07-15
3
398 Views
Last Modified: 2013-11-24
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
Comment
Question by:matthew016
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 17114269
Use an initialization servlet to load them at startup

http://www.codestyle.org/java/servers/FAQ.shtml#loadonstartup
0
 
LVL 9

Author Comment

by:matthew016
ID: 17114380
Thank you for being always so helpful.
I posted a new question, if u can help ...
Thank you.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17114609
:-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 55
word0 challenge 4 52
wordcount challenge 11 74
Error with Java/Cache JDBC Classpath 2 19
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now