<servlet>
        <servlet-name>
            jsp
        </servlet-name>
        <servlet-class>
            org.apache.jasper.runtime.JspServlet
        </servlet-class>
 <load-on-startup>
           343
</load-on-startup>
    </servlet>
其中
<load-on-startup>
</load-on-startup>
只能是整数
如果=<0说明是由服务器决定的
否则,数字大的后创建,小的先创建
个文件是你WEBAPP目录下web-inf下的web.xml!你要在这里面指定需要启动的SERVLET以及启动的顺序!

解决方案 »

  1.   

    这样不行啊,这样实际上是在启动tomcat前运行了servlet,servlet没运行完,tomcat就启动不了了
      

  2.   

    实现ServletContextListener接口好象可以,没试过
    明天试试
      

  3.   


     public class data implements ServletContextListener
    {
    public void contextInitialized (ServletContextEvent event)
    {...
    ...
    ....
    服务器初始化的时候contextInitialized 被调用