HTTP 状态 404 描述 请求的资源 () 不可用。 Apache Tomcat/7.0.27 [重复]

2023-12-26

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

HTTP 状态 404 - 类型状态报告消息描述 请求的资源 () 不可用。阿帕奇汤姆猫/7.0.27

但是如果我询问 localhost:7080/ 则可以正确找到 tomcat 的主页。

有人能帮我吗?

为什么我无法从 eclipes 获取 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>

Please look on tab "Servers" like on image: enter image description here

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

HTTP 状态 404 描述 请求的资源 () 不可用。 Apache Tomcat/7.0.27 [重复] 的相关文章

随机推荐