What is preinitialization of a servlet?

What is preinitialization of a servlet?

- The process of loading a servlet before any request comes in is called preloading or preinitializing a servlet.

- Normally, a container doesn't initialize the servlets as it starts up, it initializes a servlet when it receives a request for that servlet first time.

Some ways to preinitialize a servlet are:

1. A java servlet is initialized when it is called for the first time this is known as the default way of initializing a servlet and is also called as lazy loading.

2. To use the tag non-zero-integer with the deployment descriptor web.xml which loads and initialises the servlet when the server starts.

3. To load a servlet in order of number specified. This load on start up is loaded first and then the higher value servers are loaded after that.
What is the difference between JSP and Servlets?
What is the difference between JSP and Servlets? - JSP supports only HTTP protocol. But a servlet can support any protocol like HTTP, FTP, SMTP etc....
Difference between doGet() and doPost()
What is the difference between doGet() and doPost()? - GET Method: All data we are passing to Server will be displayed in URL. Here we have size limitation......
What's the difference between servlets and applets?
What's the difference between servlets and applets? - Unlike applets, servlets have no graphical user interface........
Post your comment