• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

load-on-startup

 
Nitin Dubey
Ranch Hand
Posts: 126
Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

What happend when we say load-on-startup for a servlet. I understand that the servlet is loaded at the startup. But..

Startup of Server ?
First hit for the Context ?
Is it guranteed ?
Which method is called when the servlet is loaded into memory ?

I basically want a servlet like StartupManager that will do all the startup activity.

Replies welcome,


Nitin Dubey
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

The container initializes the servlet when the server starts. I think, this is the description for load-on-startup

bye for now
sat
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Startup of Server ?
First hit for the Context ?
Is it guranteed ?
Which method is called when the servlet is loaded into memory ?

Its loaded when the webapp containing the Servlet is deployed. Generally this will be when the server starts - but not always depending on how your server is configured. Yes, it is guarenteed. And its the init() method which is called: as is always the case for a first request for a Servlet. Be aware when writing a startup service that there is no guarentee in the spec. for the order webapps can be deployed - s oif the service applies to more than one webapp, you will have to look to a server specific route.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, if you are using Servlet Speck 2.3 or greater, you can use a contex listener for application initialization.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic