Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Run "Hello World" project on server yields HTTP 404 error(Naive question)
Run "Hello World" project on server yields HTTP 404 error [message #1768749] Sun, 23 July 2017 12:17 Go to next message
Roparzh Hemon is currently offline Roparzh HemonFriend
Messages: 18
Registered: July 2017
Junior Member
On my Mac 10.11.3 I've installed the Eclipse JEE IDE (Version: Neon.3
Release (4.6.3)).
I created my first project (a "Dynamic Web Project") in Eclipse.
I installed Tomcat 9 (in a personal user directory, to avoid permission issues some people warned me about) and set it as the default server for the project.
Inside my project, I added the following minimal html file :

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
Hello people, it's me.
</body>
</html>


But when I did a "Run on Server" project, I get a 404 error. What did I do wrong ?
Any help appreciated.
Note : I tried "404" in this Forum's search box but got zero results.

index.php/fa/30085/0/
  • Attachment: explain6.png
    (Size: 139.35KB, Downloaded 4555 times)
Re: Run "Hello World" project on server yields HTTP 404 error [message #1768754 is a reply to message #1768749] Sun, 23 July 2017 15:37 Go to previous messageGo to next message
Nitin Dahyabhai is currently online Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Where did you add this minimal HTML file? It's not showing in your Project Explorer.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Run "Hello World" project on server yields HTTP 404 error [message #1768760 is a reply to message #1768754] Sun, 23 July 2017 17:27 Go to previous messageGo to next message
Roparzh Hemon is currently offline Roparzh HemonFriend
Messages: 18
Registered: July 2017
Junior Member
Nitin Dahyabhai wrote on Sun, 23 July 2017 15:37
Where did you add this minimal HTML file? It's not showing in your Project Explorer.


A tiny little bit of it is showing actually in the screenshot above, you can see a "index.html" window title next to the "HTTP 404 Not Found" window title. Here is a view where it is more visible :

index.php/fa/30086/0/
  • Attachment: explain7.png
    (Size: 133.67KB, Downloaded 4224 times)
Re: Run "Hello World" project on server yields HTTP 404 error [message #1768790 is a reply to message #1768760] Sun, 23 July 2017 23:52 Go to previous messageGo to next message
Nitin Dahyabhai is currently online Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

To quote the Servlet specification itself (emphasis mine):

Quote:
A special directory exists within the application hierarchy named "WEB-INF".
This directory contains all things related to the application that aren't in the
document root of the application. The WEB-INF node is not part of the public
document tree of the application. No file contained in the WEB-INF directory may
be served directly to a client by the container.


_
Nitin Dahyabhai
Eclipse Web Tools Platform

[Updated on: Sun, 23 July 2017 23:53]

Report message to a moderator

Re: Run "Hello World" project on server yields HTTP 404 error [message #1768825 is a reply to message #1768790] Mon, 24 July 2017 07:54 Go to previous message
Roparzh Hemon is currently offline Roparzh HemonFriend
Messages: 18
Registered: July 2017
Junior Member
And the correct place to put the index.html file is the WebContent directory itself. It works now, thanks.
Previous Topic:Upgrading Eclipse 3.8 to Oxygen
Next Topic:Activate e(fx)clipse FXML warning annotations?
Goto Forum:
  


Current Time: Fri Apr 19 07:19:54 GMT 2024

Powered by FUDForum. Page generated in 0.02847 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top