猿问

Tomcat报错 整个项目就一个servlet和web.xml

附上web.xml内容

<?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"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<display-name>MyFirstServletDemo</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>HelloServlet</servlet-name>
		<servlet-class>servlet.HelloServlet</servlet-class>
	</servlet>
	
	<servlet-mapping>
	<servlet-name>HelloServlet</servlet-name>
	<url-pattern>"/servlet/HelloServlet"</url-pattern>
	</servlet-mapping>
</web-app>


歆时
浏览 1875回答 1
1回答

歆时

已经自己解决了...多了个双引号 <url-pattern>/servlet/HelloServlet</url-pattern>
随时随地看视频慕课网APP

相关分类

Java
我要回答