Skip to main content



      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 08:17 Go to next message
Eclipse UserFriend
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 4965 times)
Re: Run "Hello World" project on server yields HTTP 404 error [message #1768754 is a reply to message #1768749] Sun, 23 July 2017 11:37 Go to previous messageGo to next message
Eclipse UserFriend
Where did you add this minimal HTML file? It's not showing in your Project Explorer.
Re: Run "Hello World" project on server yields HTTP 404 error [message #1768760 is a reply to message #1768754] Sun, 23 July 2017 13:27 Go to previous messageGo to next message
Eclipse UserFriend
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 4551 times)
Re: Run "Hello World" project on server yields HTTP 404 error [message #1768790 is a reply to message #1768760] Sun, 23 July 2017 19:52 Go to previous messageGo to next message
Eclipse UserFriend
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.

[Updated on: Sun, 23 July 2017 19:53] by Moderator

Re: Run "Hello World" project on server yields HTTP 404 error [message #1768825 is a reply to message #1768790] Mon, 24 July 2017 03:54 Go to previous message
Eclipse UserFriend
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: Wed Mar 19 03:15:03 EDT 2025

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

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

Back to the top