5

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>
iMysak
  • 2,170
  • 1
  • 22
  • 35
Mohsen
  • 163
  • 2
  • 3
  • 15

4 Answers4

0

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

If you don't see your project in server you need "publish" you project before. // right click on server -> "Add and Remove" -> add your project from "Available" into "Configured" -> click "finish" I hope this must help.

iMysak
  • 2,170
  • 1
  • 22
  • 35
0

I don't think if you right click on server and select "Publish" will publish your project straight away. I think you need to add the project to the server first (I could be wrong).

Usually the easiest way to run the project on the server is to right click on the project, select "Run As" and select "Run on Server".

That will give you the option to select the server you want to use (or create a new one if you haven't created one then).

ziggy
  • 15,677
  • 67
  • 194
  • 287
0

Try this move your start-page.html to your local host. in my case i try this code

sudo mv start-page.html /etc/tomcat7/Catalina/localhost

Then check your localhost if the start-page.html are there.

Then you see the 4 .xml like docs.xml, the examples.xml, the manager.xml, etc. and you must see the start-page.html then try restart again your tomcat7.

Because the 404 error means cannot fine the location of your start-page.html

j0k
  • 22,600
  • 28
  • 79
  • 90
0

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.

Hasan
  • 554
  • 1
  • 7
  • 19