Write the following in web.xml
< The servlet > < the servlet-name > initServlet </ the servlet-name > <-! - definition of the name - -> < the servlet-class > servlet.initServlet </ the servlet-class > < Load-ON-Startup > 2 </ load-oN-startup > <-! - For such loads the boot server may add this tag - -> </ the servlet > < the servlet-Mapping > <-! - definition of the class path - -> < the servlet-name > initServlet </servlet-name> <url-pattern>/initServlet</url-pattern> </servlet-mapping>