首页 > 其他分享 >Servlet的web.xml,配置映射路径(既访问的位置)

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

时间:2022-09-27 09:57:14浏览次数:52  
标签:xml web 映射 路径 Servlet Hello

<?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>

  

标签:xml,web,映射,路径,Servlet,Hello
From: https://www.cnblogs.com/5ran2yl/p/16733467.html

相关文章