Go to Home Page


Deployment Descriptor

web.xml explained below

Sampe web.xml file

web.xml explained

welcome-file-list in web.xml

welcome-file-list

Element of webapp, to define list of welcome files, welcome-file define welcome file in that list

Load On Start up

As we know the servlet loaded at the time of first request, so for first request it consumes more time. So If you specify the load-on-startup in web.xml, servlet will be loaded at project deployment time or server start. So, it will take less time for responding to first re

If you pass the positive value, the lower integer value servlet will be loaded before the higher integer value servlet

<web-app>  
  <servlet>  
   <servlet-name>hello</servlet-name>  
   <servlet-class>com.training.Hello</servlet-class>  
   <load-on-startup>0</load-on-startup>  
  </servlet>  

  <servlet>  
   <servlet-name>GenericServletExample</servlet-name>  
   <servlet-class>com.training.GenericServletExample</servlet-class>  
   <load-on-startup>1</load-on-startup>  
  </servlet>  
</web-app>

If you pass the negative value, servlet will be loaded at request time, at first request.


Go to Home Page