您的位置:首页 > 编程语言 > Java开发

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

2016-03-25 15:52 756 查看
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文件。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: