Tomcat6.0.18下出现The requested resource(/struts_login)is not available
2009-05-30 19:11
411 查看
Tomcat6.0.18下出现The requested resource(/struts_login)is not available
最近学习struts,写了一个很简单的struts小项目首次使用Tomcat6.0测试。
小项目:struts_login
开发环境:windows XP sp3、jdk1.5_15、eclipse3.3、MyEclipse6.0、Tomcat6.0.18、struts1.2.9
出现问题:输入http://localhost:8080/struts_login出现下面的错误提示页面
HTTP Status 404 - /struts_login/
type Status report
message /struts_login/
description The requested resource (/struts_login/) is not available.
Apache Tomcat/6.0.18
反复查看了仅有的两个类(LoginAction.java和LoginActionForm.java)和配置文件,都没有发现什么错误,后来将该项目部署到Tomcat5.0下却能正常运行,看来源代码并没有错误。从网上搜索解决该问题的办法,后来发现Tomcat6.0.18与Tomcat5.0.25的默认配置有一些不同(至于其他的配置有何不同暂未研研),Tomcat6默认是关闭了目录浏览功能的,这个主要是出于安全性的考虑。
对应的配置选项在apache-tomcat-6.0.18/conf/web.xml配置如下:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
解决方法:
将其中的
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
设置由false改为true,即可开启目录浏览功能
而在Tomcat5.0.25中
对应的配置选项在apache-tomcat-5.0.25/conf/web.xml配置如下:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>
org.apache.catalina.servlets.DefaultServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
已经开启目录浏览功能
本文解决方法参考自:http://sevenredcity.javaeye.com/blog/194995
最近学习struts,写了一个很简单的struts小项目首次使用Tomcat6.0测试。
小项目:struts_login
开发环境:windows XP sp3、jdk1.5_15、eclipse3.3、MyEclipse6.0、Tomcat6.0.18、struts1.2.9
出现问题:输入http://localhost:8080/struts_login出现下面的错误提示页面
HTTP Status 404 - /struts_login/
type Status report
message /struts_login/
description The requested resource (/struts_login/) is not available.
Apache Tomcat/6.0.18
反复查看了仅有的两个类(LoginAction.java和LoginActionForm.java)和配置文件,都没有发现什么错误,后来将该项目部署到Tomcat5.0下却能正常运行,看来源代码并没有错误。从网上搜索解决该问题的办法,后来发现Tomcat6.0.18与Tomcat5.0.25的默认配置有一些不同(至于其他的配置有何不同暂未研研),Tomcat6默认是关闭了目录浏览功能的,这个主要是出于安全性的考虑。
对应的配置选项在apache-tomcat-6.0.18/conf/web.xml配置如下:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
解决方法:
将其中的
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
设置由false改为true,即可开启目录浏览功能
而在Tomcat5.0.25中
对应的配置选项在apache-tomcat-5.0.25/conf/web.xml配置如下:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>
org.apache.catalina.servlets.DefaultServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
已经开启目录浏览功能
本文解决方法参考自:http://sevenredcity.javaeye.com/blog/194995
相关文章推荐
- 【转】tomcat 访问软连接文件夹下的网页出现404错误,description The requested resource (/xxx.html) is not available.
- Tomcat6.0.18下出现The requested resource(/)is not available
- Tomcat6.0.18下出现The requested resource(/)is not available
- Tomcat6.0.18下出现The requested resource(/)is not available
- HTTP Status 404 ,The requested resource (/struts2_test/login) is not available.
- 用Flex写一个HelloWord出现了flex The requested resource (...) is not available.
- 运行JSP时出现The requested resource (/proj3/MyJsp.jsp) is not available.出现这种情况的原因有多种,这是其中一种(亲测有用)
- Tomcat7下出现The requested resource(/)is not available
- "The requested resource (... processLogin.action) is not available"的问题所在及解决办法
- 出现The requested resource is not available.错误
- eclipse新建web项目运行时出现The requested resource is not available异常
- 错误:“The requested resource () is not available.”的处置
- 因配置不对,导致出现The requested resource is not available的解决方法
- tomcat配置问题解决之The requested resource (/host-manager/) is not
- j2ee The requested resource () is not available.
- web程序无法访问:The requested resource () is not available.错误
- java异常处理:The requested resource () is not available
- !!注意!部署出现the requested resource is not available
- servlet web.xml配置好以后还会出现 the requested resource is not available错误的可能原因
- ssh中The requested resource () is not available.