gpt4 book ai didi

java - Tomcat 404 错误 : The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

转载 作者:IT老高 更新时间:2023-10-28 20:50:15 30 4
gpt4 key购买 nike

我按照 o7planning 的教程进行操作,但在第 6 步卡住了:

http://o7planning.org/en/10169/java-servlet-tutorial

这只是一个显示 HelloWorld 的简单项目,但由于某种原因,我不断收到 404 错误。详情:

enter image description here但是 Tomcat 欢迎页面显示正常。

Tomcat welcome page

到目前为止我尝试过的解决方案(但它们不起作用):

Right-click project -> properties -> Project Facets -> Runtimes -> checked "Apache Tomcat v9.0" -> Apply -> finish.

Server tab -> Right-click "Tomcat v9.0..." -> properties -> switch location -> Choose "Use tomcat installation" on "Server locations" panel.

最佳答案

问题已解决,我没有添加 index.htmlweb.xml

中指出了这一点

enter image description here

注意:一个项目可能有多个web.xml文件。

如果

中还有另一个 web.xml

src/main/webapp/WEB-INF

那么你可能需要添加另一个索引(这次是index.jsp)到

src/main/webapp/WEB-INF/pages/

关于java - Tomcat 404 错误 : The origin server did not find a current representation for the target resource or is not willing to disclose that one exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43186315/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com