首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

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

2013-03-21 
eclipse新建web项目运行时出现The requested resource is not available错误在eclipse里新建了一个web项目

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文件。

?

热点排行