Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

autoloading servlet on starting tomcat

 
shitiz mathur
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
friends with the help of this wonderfull site i have been able to run my servlets successfull yon tomcat. now i have some servlets whic hi require to autoload as soon as i start tomcat. can you help me with how to do this??
shitiz
 
Praveen
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Hope this will help you.
Go to <tomcat home directory>/conf/web.xml
and you will see the xml code somethig like this :---
- <web-app>
- <servlet>
<servlet-name>default</servlet-name>
<servlet- class>org.apache.tomcat.servlets.DefaultServlet</servlet-class>
<load-on-startup>-2147483646</load-on-startup>
</servlet>
- <servlet>
..........
Here you can specify that which servlets you want to laded automatically on tomcat startup by specifying :
<servlet>
<servlet-name>...specify whatever name you want to specify for your servlet...</servlet-name>
<servlet- class>...class name of Servlet with full path...</servlet-class>
<load-on-startup>-2147483646</load-on-startup>
</servlet>
- <servlet>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!