错误截图:
![错误截图](https://img-blog.csdnimg.cn/2022010612440117418.png)
创建时的设置:
![](https://img-blog.csdnimg.cn/2022010612440158817.png)
![](https://img2018.cnblogs.com/blog/1662636/201908/1662636-20190821213131069-870828699.png)
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="4.0">
<servlet>
<servlet-name>demo01</servlet-name>
<servlet-class>com.learning.web.servlet.ServletDemo01</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>demo01</servlet-name>
<url-pattern>/demo01</url-pattern>
</servlet-mapping>
</web-app>
解决一:
将红框内 Application contet文本框设置为空。
此时在浏览器中输入的是localhost:8080/demo01
解决二:
不改变Application context中的内容,在浏览器中应该输入的是localhost:8080/learning03_war_exploded/demo01
注意虚拟路径的问题。
转载于:https://www.cnblogs.com/letherwave/p/11390863.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)