Servlet的web.xml,配置映射路径(既访问的位置)

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
                      http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="3.1"
         metadata-complete="true">
    <!--注册servlet-->
<servlet>
    <servlet-name>Hello</servlet-name>
    <servlet-class>top.lostyou.servlet.HelloServlet</servlet-class>
</servlet>
    <!-- servlet的请求路径-->
    <servlet-mapping>
        <servlet-name>Hello</servlet-name>
        <url-pattern>/Hello</url-pattern>
    </servlet-mapping>
</web-app>

  

posted @ 2022-09-27 09:46  回忆也交给时间  阅读(211)  评论(0编辑  收藏  举报