eclipse - HTTP 状态 404 描述 请求的资源 () 不可用。 Apache Tomcat/7.0.27

标签 eclipse tomcat7

这个问题在这里已经有了答案:





JSP in /WEB-INF returns "HTTP Status 404 The requested resource is not available"

(3 个回答)


5年前关闭。




当我尝试通过 http://localhost:7080/first/ 访问我的项目主页时或 http://localhost:7080/first/start-page.html我收到这条消息:

HTTP 状态 404 - 类型 状态报告消息描述 请求的资源 () 不可用。 Apache Tomcat/7.0.27

但如果我要求 localhost:7080/正确找到了 tomcat 的主页。

有人能帮我吗?

为什么我无法从 eclipse 中获取我的 start-page.html?
但是当我从 C:\Users\Mohsen\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\first\WEB-INF\start-page.html 运行时,它运行正常。

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>first page</title>
</h:head>
<h:body>
<fieldset>
<legend>Random Results Page</legend>
<h:form>
Press button to get one of three possible results pages.
<br/>
<h:commandButton value="Go to Random Page"
/>
</h:form>
</fieldset>
…
</h:body></html>

最佳答案

请查看“服务器”选项卡,如图所示:
enter image description here

如果您没有在服务器中看到您的项目,则您需要“发布”您之前的项目。
//右键单击服务器->“添加和删除”->将您的项目从“可用”添加到“已配置”中->单击“完成”
我希望这一定会有所帮助。

关于eclipse - HTTP 状态 404 描述 请求的资源 () 不可用。 Apache Tomcat/7.0.27,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10207033/

相关文章:

java - 有关套接字和黑莓的帮助

eclipse - todo 标签在 eclipse 和 pydev 上不起作用

java - xampp和net beans可以一起用于tomcat吗

windows - 如何使用命令行安装将 Tomcat 7 安装为 Windows 服务

java - tomcat中的logback配置

docker - 使用Ha Proxy负载均衡docker swarm

android - Eclipse/Android 原始 txt 文件错误 (Content is not allowed in prolog)

java - eclipse运行后老是崩溃

java - 错误 : Selection does not contain a main type

java - Tomcat7配置jndi mysql连接