我用的是RESIN不用部署WEB.XML文件
只要编译之后把字节码文件放到WEB-INF/classes目录下就可以了

解决方案 »

  1.   

    你用Jbuilder做的话可以自动生成,不用你自己写.
      

  2.   

    不用,可以加入invoker完成调用任意servlet的功能。如:
    http://localhost/MySite/servlet/org.mysite.servlet.MyServlet?param1=1web.xml配置方法阅读tomcat/conf/web.xml  <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
      <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
      <!-- servlet is mapped to the URL pattern "/servlet/*", but you can map   -->
      <!-- it to other patterns as well.  The extra path info portion of such a -->
      <!-- request must be the fully qualified class name of a Java class that  -->
      <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
      <!-- of an existing servlet definition.     This servlet supports the     -->
      <!-- following initialization parameters (default values are in square    -->
      <!-- brackets):                                                           -->
      <!--                                                                      -->
      <!--   debug               Debugging detail level for messages logged     -->
      <!--                       by this servlet.  [0]                          -->    <servlet>
            <servlet-name>invoker</servlet-name>
            <servlet-class>
              org.apache.catalina.servlets.InvokerServlet
            </servlet-class>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>    <!-- The mapping for the invoker servlet -->    <servlet-mapping>
            <servlet-name>invoker</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
        </servlet-mapping>