簡體   English   中英

如何在我的Web項目中閱讀web.xml

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

我寫了一個基本的Hello World我們動態項目,其中安裝了apache服務器。

我的目錄結構是 在此處輸入圖片說明

Web.xml的內容是,

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

  </welcome-file-list>

hello.html是,

<!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>

在啟動我的Apache之后,我正在嘗試訪問URL,
HTTP://本地主機:8080 / hello.html的
錯誤為: HTTP狀態404- /hello.html
有什么建議嗎?

我會說您需要進入更深的目錄。

HTTP://本地主機:8080 /的WebContent / hello.html的

我認為以上一種應該有效:)

通常,此錯誤是由使用端口8080的其他應用程序引起的,請檢查同一端口上是否還有其他程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM