简体   繁体   中英

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, 在此处输入图片说明

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?

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

I would say you need to into a deeper directory.

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

The above one should work I think :)

通常,此错误是由使用端口8080的其他应用程序引起的,请检查同一端口上是否还有其他程序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM