按照网上的学习视频写了个Servlet,但是启动浏览器访问显示404,也就是未找到网络资源:
访问servlet 显示404
看了网上的各种帖子,主要原因都是配置文件web.xml的问题,例如https://blog.csdn.net/abc321tyu/article/details/62898887
但是我这个配置文件没有问题,多次尝试原来是自己比较菜,浏览器没有访问正确的url的问题:
访问servlet 显示404
因为我的IDEA调用的Tomcat服务器,有个默认的热部署虚拟地址:
访问servlet 显示404

所以应该访问:
http://localhost:8080/Java_Web_v1_war_exploded/test
访问servlet 显示404
而不是
localhost:8080/test

——————如果你改变了热部署虚拟地址为空—————
访问servlet 显示404
就可以使用localhost:8080/test

相关文章:

  • 2021-08-04
  • 2021-08-26
  • 2021-11-18
  • 2021-11-13
  • 2021-11-18
  • 2021-04-13
  • 2022-12-23
猜你喜欢
  • 2021-08-02
  • 2021-09-16
  • 2021-12-26
  • 2022-12-23
  • 2022-01-20
  • 2021-12-11
  • 2022-12-23
相关资源
相似解决方案