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文件。
在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文件。
相关文章推荐
- 《Java 2 实用教程》读书笔记(四)4.4
- Java Web SSH框架总是无法写入无法读取Cookie
- 照片EXIF信息的读取和改写的JAVA实现
- 照片EXIF信息的读取和改写的JAVA实现
- Struts1的处理流程
- SpringMVC工作原理
- HDU-ACM2015偶数求和
- Java代码规范
- JavaWeb项目开发案例精粹-第2章投票系统-006view层
- JAVA远程操作Zookeeper示例
- 多线程同步的巧用
- javaweb学习总结(六)——Servlet开发(二)
- JavaWeb项目开发案例精粹-第2章投票系统-005实体层
- JAVA中instanceof的作用和用法
- java 加密解密算法MD5/SHA1,DSA
- JavaWeb项目开发案例精粹-第2章投票系统-004action层
- 【学习笔记】Java抽象类和接口的一些总结
- Spring AOP原理
- Java反射机制分析
- SpringMVC手动配置