【问题标题】:Tomcat server webappsTomcat 服务器网络应用程序
【发布时间】:2021-01-17 19:57:21
【问题描述】:

我安装 tomcat 9.0。当我运行 localhost:8080 它工作正常。在 webapps 文件夹下,我制作了 Beer-V1 文件夹并制作了 form.html 文件。当我尝试在浏览器中访问 form.html 文件时,它显示 404 错误。请帮助我如何访问 form.html 文件? (localhost:8080/Beer-V1/form)

Type Status Report

Message The requested resource [/Beer-V1/form] is not available

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

【问题讨论】:

  • 请提供minimal reproducible example。你的文件夹结构是什么?你的区分大小写怎么样?如果我们什么也没看到,我们能提供什么帮助?
  • [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\Beer-V1\form.html = 文件夹结构].......当我运行这个 [ localhost:8088/Beer-V1/form.html] 发生错误。显示此 [请求的资源 [/Beer-V1/form.html] 不可用].......我已经正确检查了区分大小写..没有错误......可能是某种权限问题?? ??
  • 您的问题解决了吗?

标签: java tomcat


【解决方案1】:

您点击的 URL 不正确,您缺少添加 .html 的文件名,例如“form.html”。

应该是 localhost:8080/BeerV1/form.html

另外,您可以参考here 了解基本的 tomcat 部署。

【讨论】:

  • [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\Beer-V1\form.html = 文件夹结构].......当我运行这个 [ localhost:8088/Beer-V1/form.html] 错误发生。显示此 [请求的资源 [/Beer-V1/form.html] 不可用].......我已经正确检查了区分大小写..没有错误......可能是某种权限问题?? ??
  • localhost:8088/Beer-V1/form.html - 只是为了确认一下,之前你提到了 8080 端口,现在是 8088 。
  • 另外,尝试在 webapps 文件夹下制作 index.html 文件,看看是否出现。这样你就可以确认你的服务器没有任何问题,然后在你的 Beer-v1 文件夹下检查。
  • 我已将端口更改为 8088。localhost:8088 和 localhost/8088/docs 正在运行,但在 webapps 下添加 index.html 后它没有运行。 [localhost:8088/index.html] = 404 错误
  • 请回答我卡住了
最近更新 更多