eclipse新建web项目运行时出现The requested resource is not available异常

来源:互联网 发布:js 数据结构 字符搜索 编辑:程序博客网 时间:2024/06/06 00:27
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文件。

0 0