• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

starting servlet when application loads

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My problem is that I want a servlet to be loaded when my application is accessed the first time.
The application starts through a login page.
hence the servlet should be loaded AFTER the login page has been requested the first time
I am using tomcat 4.1.27
Pls help
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hence the servlet should be loaded AFTER the login page has been requested the first time
AFTER, or before?
Anyways, I think what you're after is the tag <load-on-startup> in web.xml. It tells the servlet container to load and initialize the servlet when the container starts up. Have a look at it in the servlet specification.
[ November 02, 2003: Message edited by: Andres Gonzalez ]
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A servlet would be loaded when it is accessed for the first time..unless it has been specified as one of the "load-on-startup" servlets in the deployment descriptor as specified earlier.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic