MSD
MSD

Reputation: 1407

How to see the web.xml is read in my Web project

I wrote a basic Hello World we dynamic project with the apache server installed with it.

My directory structure is, enter image description here

Web.xml content is,

  <display-name>hello</display-name>
  <welcome-file-list>
    <welcome-file>hello.html</welcome-file>

  </welcome-file-list>

hello.html is,

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Hello World!!
</body>
</html>

After starting my apache, I'm trying to access the URL,
http://localhost:8080/hello.html
Getting error as : HTTP Status 404 - /hello.html
Any suggestion?

Upvotes: 1

Views: 377

Answers (3)

Jack Flamp
Jack Flamp

Reputation: 1233

It think you need to add the name of your project in the url:

http://localhost:8080/ProjectName/

or http://localhost:8080/ProjectName/hello.html

Upvotes: 2

BotMaster3000
BotMaster3000

Reputation: 482

I would say you need to into a deeper directory.

http://localhost:8080/WebContent/hello.html

The above one should work I think :)

Upvotes: 0

Abbas Abbas
Abbas Abbas

Reputation: 45

Usually this error is from other applications using the port 8080, check if any program else on same port.

Upvotes: 0

Related Questions