Tomcat 404 错误:源服务器没有找到目标资源的当前表示或不愿意透露一个存在 [英] Tomcat 404 error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

查看:73
本文介绍了Tomcat 404 错误:源服务器没有找到目标资源的当前表示或不愿意透露一个存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 o7planning 的教程,但卡在第 6 步:

但是 Tomcat 欢迎页面显示正常.

这是我迄今为止尝试过的解决方案(但它们不起作用):

<块引用>

右键单击项目->属性 ->项目方面 ->运行时 ->选中Apache Tomcat v9.0";->应用 ->结束.

服务器选项卡 ->右击Tomcat v9.0...";->属性 ->切换位置 ->选择使用tomcat安装"在服务器位置"上面板.

解决方案

问题解决了,我没有添加index.html.web.xml

中指出

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

如果

中还有另一个web.xml<块引用>

src/main/webapp/WEB-INF

然后您可能需要向

添加另一个索引(这次是index.jsp)<块引用>

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

I was following the tutorial on o7planning and got stuck at step 6:

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

It's just a simple project that show HelloWorld but for some reason I keep getting 404 error. Detail:

However the Tomcat welcome page showing properly.

Here solutions that I've tried so far (and they are NOT working):

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.

解决方案

Problem solved, I've not added the index.html. Which is point out in the web.xml

Note: a project may have more than one web.xml file.

if there are another web.xml in

src/main/webapp/WEB-INF

Then you might need to add another index (this time index.jsp) to

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

这篇关于Tomcat 404 错误:源服务器没有找到目标资源的当前表示或不愿意透露一个存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆