eclipse新建web項目運行時出現The requested resource is not available異常

eclipse新建web項目運行時出現The requested resource is not available錯誤

  在eclipse裏新建了一個web項目,加了一個test1.jsp。

         新建了一個tomate的server,綁定到項目裏。Run-As->Run On Server, 網頁中顯示The requested resource is not available錯誤。

  解決辦法:

  1.檢查jsp的目錄是否正確,要放到WebContent下面,不能在其他目錄下,很多人誤操作會放到WEB-INF下面。

  2.檢查server項目的web.xml中,

  <init-param>

  <param-name>listings</param-name>

  <param-value>true</param-value>//默認是false,此處要改成true

  </init-param>

  3.檢查訪問的URL是否拼寫正確。

  4.檢查jsp文件的名字是不是在項目的web.xml中出現了,(這個在其他人的解決辦法中看到,貌似名字不匹配也可以訪問,作爲參考)

  <welcome-file-list>

  <welcome-file>index.html</welcome-file>

  <welcome-file>index.htm</welcome-file>

  <welcome-file>index.jsp</welcome-file>

  <welcome-file>default.html</welcome-file>

  <welcome-file>default.htm</welcome-file>

  <welcome-file>default.jsp</welcome-file>

  </welcome-file-list>

  如果爲出現,可以重命名文件爲index.jsp或者修改web.xml文件。

發佈了391 篇原創文章 · 獲贊 11 · 訪問量 39萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章