Servlet action is not available 问题解决
来源:互联网 发布:乔麦克纳利 知乎 编辑:程序博客网 时间:2024/05/21 03:56
环境eclipse3.2+myeclipse+tomcat5.0x
重要提示:出现这个问题的原因很多,最多见的是配置文件出错不能初始化出现Servlet action is not available提示。要解决问题需要具体问题具体分析,多看容器的logs。
背景提示,我要做struts+spring+hibernate的配置,但是按照书上说的配置好了后,总是错误,提示Servlet action is not available后台log就提示2006-03-22 22:34:09 StandardWrapperValve[action]: Servlet action is currently unavailable。弄了很久没有弄好。后来看了很久的log才发现提示配置文件中有错误,所以把action设置为null。
在找这个错误,找了很久才发现:一个是
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/classes/applicationContext.xml" />
</plug-in>
在struts中配置spring插件时,applicationContext.xml(spring的配置文件)位置错了,书上一般是"/WEB-INF/applicationContext.xml" 但是有的时候不是在这个下面。所以一定要自己到容器下看看具体位置。比如我的就是在web-inf/classes下。
二是:在spring的配置文件下的插入hibernate的配置文件
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>file:src/hibernate.cfg.xml</value>
</property>
</bean>
myeclipse自动添加的是这样的,我一直没有注意,结果应该为:
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>file:src/hibernate.cfg.xml</value>
</property>
</bean>
提示:hibernate.cfg.xml文件的具体位置你要到容器下去看。
重要提示:
1、还有就是一定要在struts配置文件中加: <controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/>。这样你的action才能真的委托给spring。
2、我发现我的myeclipse没有把spring.jar拷贝到lib下,以后大家出了问题可以看看。
利用spring+hibernate+struts过程中,发现一个问题,在action中将一个hibernate读取出来的ArrayList存入session:request.getSession().setAttribute("treeFromRoot", treeList.iterator());
在jsp中用标签 读取代码如下:会出现Cannot create iterator for this collection 错误,弄了一下午都没有搞定。
<logic:iterate type="edu.scnu.es.struts.vo.Tree" id="tree"
name="treeFromRoot">
</logic:iterate>
</logic:notEmpty>
最后决定用JSTL试一试,代码改为:成功了。
${treeFromRoot1.id };
</c:forEach>
其中:edu.scnu.es.struts.vo.Tree是treeFromRoot这个list的成员的原形类。
- Servlet action is not available 问题解决
- Servlet action is not available
- Servlet action is not available
- Servlet action is not available
- Servlet Action is not available
- Servlet action is not available
- Servlet action is not available的问题
- Servlet action is not available 又一原因
- HTTP-404:Servlet action is not available
- Servlet action is not available 总结
- Servlet action is not available问题
- Servlet action is not available异常解决
- the requested resource servlet action is not available is not available的解决方案
- description The requested resource (Servlet action is not available) is not available.
- Servlet action is not available(Struts+Spring+Hibernate)
- HTTP-404:Servlet action is not available错误解决
- Servlet action is not available 终于找到了错误原因
- HTTP Status 404 - Servlet action is not available
- 爱情转移
- 网站繁简转换解决方案--ASP,JSP,PHP,.Net通用
- 保养皮肤的20种方法
- Repeater的应用之嵌套和行操作
- Linux命令_1
- Servlet action is not available 问题解决
- linux下java环境
- VML 画统计 柱状、饼图、折线
- 编写驱动必须清楚的三个概念(soft driver)
- Linux命令_2
- VML多店销售折线图
- 春分
- 中国的互连网
- VML书签