<servlet-mapping>
<servlet-name>helloServlet</servlet-name>
<url-pattern>/helloServlet</url-pattern>
</servlet-mapping>
Servlet-mapping标签内少了url-pattern标签
那应该怎么加呢
加个子节点
<url-pattern>*.html</url-pattern>
你可以多用alt+/ 懒人技巧会有意想不到的结果
<servlet>
<servlet-name>helloServlet</servlet-name>
<servlet-class>com.servlet.ServletDemo1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>helloServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping> <servlet-name>hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping>