You can specify a servlet to load when JavaWebServer loads.

1. Go to the admin tool.
2. Double click on 'Web Service'
3. Click on 'Servlets' button
4. Click on 'Add'
5. Enter a name and the fully qualified class name of the servlet
6. Click on the 'Add' button
7. The servlet should be added to the tree. Click on it.
8. You should now see a panel with 2 tabs, configuration and properties
9. Find the Load at Startup radio button and select 'Yes'.

All done.

Typically what some people do is to specify one servlet that loads at
startup. This servlet instantiates beans or sets variables (eg a pool of db
connections) and then stores them in the servlet context.

When other servlets run, they get the required 'global' resource(s) from the
servlet context.

You may want to search the archives regarding this issue. Smarter people
than me have given better explanations of the design patterns required for
this.

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Paul Medcraft
> Sent: Thursday, 25 November 1999 4:20
> To: [EMAIL PROTECTED]
> Subject: Preloading a servlet in Java Webserver. Possible?
>
>
> I'm developing an application that needs to initialise a pool of
> beans when
> the server starts up. I am using JSDK Java WebSrver v2.1, but cannot find
> anything in the config to specify a servlet to  when the server
> is started.
> Anyone know if this is possible and if so how?
>
> Thanks,
>
> Paul
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to