Solved

J2EE

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

696 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