It is a good idea. The mini-server that comes with JSDK 2.1 can be
setup to work this way, especially since it doesn't support pre-loading
of servlets anyway. I created my own startup class, that has a main()
which does all of my initialization, then calls the main() class of
this mini-server:

public class JumpStart
{
        public static void main(String arg[])
        {
                SQL.init();
                com.sun.web.shell.Startup.main(arg);
        }
}

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
pascal jacob
Sent: Friday, June 11, 1999 12:40 PM
To: [EMAIL PROTECTED]
Subject: Re: Servlets and Applications


    I had the same "intellectual" problem concerning the lack of a single
entry point for a set of servlet that compose a single web-application.
    What I was thinking about, is that it would be cool if the javax.servlet
package define a higher level class (name it webapp) having a function
main() that would be called once and only once before any of the servlet the
compose the web application enter its init() function.
    This webapp class, elong with its main() function would then represents
a concept similar to the main class of regular application.
    isn't it a good idea ?

ZartC++


> Hi:
>
> I was wondering how other developers got around the problem I am now
facing.
> I am about to start working on a project that is going to use Servlets
> extensively, but I am running into a problem in determining the best
> approach to take to allow the Servlets communicate with non-servlet based
> classes (business classes).
>
> For example, a Database Connection pool.  Most discussions about this
topic
> involve using a Singleton pattern and just getting a connection from the
> pool when one is necessary.  Thats nice and all and is in fact the
approach
> I have taken in all the Servlets that I have developed up to this point.
> But what if you have 5, 10 or more Servlets that need to use the the same
> Connection Pool?  Which one is responsible for initializing the pool?  All
> of them? If that is the case, that might cause problems when maintaining
the
> system (one class sets the wrong parameter).
>
> My situation is similar to that, except the Objects that my Servlets will
> communicate with are business objects like CustomerCreator,
InvoiceCreator,
> ShipmentCreator, etc...In application development, since I am in control
of
> what gets started when and setting up the communication links between
> Objects and classes, I have never had problems.  But with Servlets, I
can't
> think of a similar approach other than the Singleton design pattern.
>
> I was just wondering how developers who have developed larger servlet
based
> applications got their Servlets and their Business Objects to talk to each
> other....
>
> Thank you in advance,
>
>
> Chris Gow
> [EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to