Solved

J2EE

Posted on 2006-07-15
3
420 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 96
Java Timer (static) 9 43
nextBoolean(double p) for Random class 3 40
servlet web applications   metadata-complete="true" or false 3 40
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

773 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