There are many task happening internally inside the Web-Server. Following are the list of task performed at the container start-up :
1. Reads the web.xml file or Annotations specified on various web components and stores all the required information in the main memory.
2. Container creates the ServletContext object and initialized with ServletContext object parameter specified in the web.xml file.
3. Thread Pool will be created by the container.
4. All the listener will be initialized.
5. All the filter will be initialized.
6. Checks whether any servlet is configured with < load-on-startup > tag must be loaded first and the instance will be created by calling the default constructor.
For ex: Servlet confiured with < load-on-startup > value ' 1' is loaded first.
7. If no < load-on-startup > tag is mentioned then loads the servlet class when request will come.
8. Container creates the ServletConfig object and initialized it with the ServletConfig parameter specified in the web.xml file or Annotation.
9. ServletConfig object will be initliazed with the ServletContext object.
10. Finally after creating all the instance and initialization the ServletLife cycle method will be called by the container and first to call is init() by passing ServletConfig instance as parameter.
Note :
* Init() method is internally called by the container to initialize the ServletConfig instance with the required parameters.
* If any of the process failed before loading and initializing the servlet class then class will not be loaded and initialized.
1. Reads the web.xml file or Annotations specified on various web components and stores all the required information in the main memory.
2. Container creates the ServletContext object and initialized with ServletContext object parameter specified in the web.xml file.
3. Thread Pool will be created by the container.
4. All the listener will be initialized.
5. All the filter will be initialized.
6. Checks whether any servlet is configured with < load-on-startup > tag must be loaded first and the instance will be created by calling the default constructor.
For ex: Servlet confiured with < load-on-startup > value ' 1' is loaded first.
7. If no < load-on-startup > tag is mentioned then loads the servlet class when request will come.
8. Container creates the ServletConfig object and initialized it with the ServletConfig parameter specified in the web.xml file or Annotation.
9. ServletConfig object will be initliazed with the ServletContext object.
10. Finally after creating all the instance and initialization the ServletLife cycle method will be called by the container and first to call is init() by passing ServletConfig instance as parameter.
Note :
* Init() method is internally called by the container to initialize the ServletConfig instance with the required parameters.
* If any of the process failed before loading and initializing the servlet class then class will not be loaded and initialized.
0 comments:
Post a Comment