<!-- servlet映射方式1 --> <servlet> <servlet-name>myServlet1</servlet-name> <servlet-class>www.hw.web.MyServlet1</servlet-class> </servlet> <servlet-mapping> <servlet-name>myServlet1</servlet-name> <url-pattern>/myServlet1</url-pattern> </servlet-mapping> <!-- servlet映射方式2 --> <servlet> <servlet-name>myServlet2</servlet-name> <servlet-class>www.hw.web.MyServlet2</servlet-class> </servlet> <servlet-mapping> <servlet-name>myServlet2</servlet-name> <url-pattern>/servlet/*</url-pattern> </servlet-mapping> <!-- servlet映射方式3 --> <servlet> <servlet-name>myServlet3</servlet-name> <servlet-class>www.hw.web.MyServlet3</servlet-class> </servlet> <servlet-mapping> <servlet-name>myServlet3</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>
标签:web,www,映射,方式,myServlet1,myServlet3,myServlet2,hw,Servlet From: https://www.cnblogs.com/weiduaini/p/17240327.html