因此,我正在自学 Java,并按照 Java for Dummies 第 3 版中的设置说明进行操作。我正在尝试设置我的计算机以便我可以运行 servlet。我按照所有说明进行操作,在运行启动文件后,tomcat 设置似乎从我的命令提示符中的这一行开始工作
Server Startup in 547 ms however when i type in the following url from the book to test it http://localhost:8080/servlets-examples/index.html
我收到这个错误
HTTP Status 404 - /servlets-examples/index.html
type Status report
message /servlets-examples/index.html
description The requested resource is not available.
Apache Tomcat/8.0.23
我还应该补充一点,我尝试多次更改 server.xml 文件中的服务器端口并将其输入 url 而不是 8080,但仍然收到相同的消息。我在 chrome 和 firefox 中试过这个,但它在任何一个上都不起作用。有没有人经历过这个并且知道如何解决它?可能是我的计算机安全受到阻碍,或者 url 已更改,还是我没有正确设置它?
最佳答案
404 表示服务器正常工作,但找不到文档 /servlets-examples/index.html
。
只需检查 URL http://localhost:8080 (它应该显示一个默认的介绍页面)
关于java - 设置tomcat时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30877066/