You need to do something like this:

  <servlet>
      <servlet-name>ApplicationStartup</servlet-name>
      <display-name>StartUp Servlet</display-name>
      <servlet-class>a.startup.ApplicationStartup</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet> 

   <servlet-mapping>
      <servlet-name>ApplicationStartup</servlet-name>
      <url-pattern>/startup</url-pattern>
   </servlet-mapping>

This tells tomcat to run that servlet when Tomcat first intialises the
context. You can put all your initialisation stuff there I guess.

Regards...
Arup Vidyerthy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 27 July 2005 14:41
To: [email protected]
Subject: Instantiating an Application Scoped Bean


Hi,

 
I need some help on the following scenario:

 
As soon as I start my tomcat server, I need to populate an
application-scoped bean which will have values from the database.
Thereafter I should be able to access the bean across all JSP pages using
the <jsp:useBean "..." ...scope="application"/> tag.

 
It'll be great if you guys can tell me how to initialize this bean at server
startup. Any specific web.xml entry to be recorded to map to the servlet
which does the DB operation? 
 
Thanks!





Confidentiality Notice
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify the sender at Wipro or [EMAIL PROTECTED]
immediately and destroy all copies of this message and any attachments.


        
        
                
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to