且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-10-19 15:58:07

我想你创建了xhtml文件 文件和更改文件扩展名。这是错的您应该创建一个html文件并再次配置扩展名。然后点击下一个按钮。之后,您应该选择新的Facelet模板。然后完成


when i try to access my project home at http://localhost:7080/first/ or http://localhost:7080/first/start-page.html i get this message:

HTTP Status 404 - type Status report message description The requested resource () is not available. Apache Tomcat/7.0.27

but if i ask for localhost:7080/ the home page of tomcat is correctly found.

can someone help me?

why i can't get my start-page.html from eclipes? but when i run from C:\Users\Mohsen\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\first\WEB-INF\start-page.html, it runs correctly.

<?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>

I think you created "xhtml file", creating a "file" and changing the file extension. This is wrong. You should create a html file and configure again extension. Then click the next button. After that, you should choose "New Facelet Template". Then finish.