在web.xml中配置一个servlet

xiaoxiao2021-03-01  3

<?xml version="1.0" encoding="utf-8"?><web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>student</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>test</servlet-name> <servlet-class>com.test.test</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>test</servlet-name> <url-pattern>/test</url-pattern> </servlet-mapping></web-app> <servlet-name>test</servlet-name>servlet的名称 <servlet-class>com.test.test</servlet-class>servlet的类全称(包名.类名) <load-on-startup>1</load-on-startup>是否在服务器启动时就加载,如果不用在服务器启动时就加载可以去掉此项 <url-pattern>/test</url-pattern>servlet的访问路径 相关资源:带音效新年烟花动画特效-HTML-代码
转载请注明原文地址: https://www.6miu.com/read-3850151.html

最新回复(0)