在web.xml中配置servlet(多个servlet的配置方式)

时间:2021-10-15 13:54:38
 <servlet>  <servlet-name>FirstServlet</servlet-name>  <servlet-class>servlet.FirstServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>ThreeParams</servlet-name>
        <servlet-class>servlet.ThreeParams</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>Verify</servlet-name>
        <servlet-class>servlet.Verify</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>ShowMessage</servlet-name>
        <servlet-class>servlet.ShowMessage</servlet-class>
    </servlet>    
    <servlet>
        <servlet-name>AddMessageServlet</servlet-name>
        <servlet-class>servlet.AddMessageServlet</servlet-class>
    </servlet>
  <servlet-mapping>
        <servlet-name>FirstServlet</servlet-name>
        <url-pattern>/FirstServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>ThreeParams</servlet-name>
        <url-pattern>/ThreeParams</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Verify</servlet-name>
        <url-pattern>/Verify</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>ShowMessage</servlet-name>
        <url-pattern>/ShowMessage</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>AddMessageServlet</servlet-name>
        <url-pattern>/AddMessageServlet</url-pattern>
    </servlet-mapping>