• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

starting servlet when application loads

 
JohnV Varghese
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • 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 ]
 
Celina Paul
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic