请问为何我配置了ActionMappings和ActionFormBeans在载入页面,还会报这个错误呢?马上给分,祝节日愉快

ervinlj 2004-05-02 04:13:03
各位网友,大家好:
小弟我初学Struts,碰到一个棘手问题,烦劳各位高人帮我看一下:
这是我的Jsp文件inputContent.jsp:
<html>
<head>
<title>
A Simple Test Struts Application
</title>
</head>
<body>
<%@ taglib uri="WEB-INF/app.tld" prefix="app" %>
<%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %>
<h1>
A Simple Test Struts Application
</h1>
<html:messages id="mymessage" />
<app:department />
<app:skill />
<html:form action="empaction.do">
。。。
</html:form>
</body>
</html>

web.xml文件如下:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<description>
The Web.xml configuration of Struts Test Sample Application
</description>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>

struts-config.xml文件如下:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="empForm" type="com.example.EmpForm" />
</form-beans>
<action-mappings>
<action path="/empaction"
type="com.example.EmpAction"
name="EmpForm"
scope="request"
input="/inputContent.jsp">
<forward name="success" path="/outputContent.jsp">
</action>
</action-mappings>
</struts-config>
出的错误如下:
description The server encountered an internal error () that prevented it from fulfilling this

request.
exception
org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
我的ActionFormBean--EmpForm和Action--EmpAction是完全能编译通过的,可是在载入Jsp页面inputContent.jsp却会出现以上的错误,请各位高人看看,为什么没能找到ActionMappings和ActionFormBeans???
web.xml文件和struts-config.xml文件放的位置也应该都是正确的,都在我应用程序的WEB-INF目录下,这应该没有问题的呀!!!谢谢各位,马上给分的哈!!!
我用的是Struts1.2
...全文
100 12 点赞 打赏 收藏 举报
写回复
12 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
bitiwang 2004-05-05
我也是初学者,我已经对struts恐惧了,太难调试了!准备放弃!!!!
struts最大缺点莫过于此。
  • 打赏
  • 举报
回复
pengfeitian 2004-05-04
zging!!!
  • 打赏
  • 举报
回复
crazycy 2004-05-03
配置应该没问题的
<html:form action="empaction.do">
。。。
</html:form>
这里的<html:form action="empaction.do">有method="post"这句?
若有,嘿嘿,也跟着一起学习
  • 打赏
  • 举报
回复
ervinlj 2004-05-03
各位高人快来救我啊!!!40分全给啊!!!
  • 打赏
  • 举报
回复
ervinlj 2004-05-03
见鬼,这个问题就没有高人能帮我解决的吗?
  • 打赏
  • 举报
回复
ervinlj 2004-05-03
我将web.xml文件中加入config参数改成这样:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<description>
The Web.xml configuration of Struts Test Sample Application
</description>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
还是没有成功,到底是什么原因啊???
  • 打赏
  • 举报
回复
ervinlj 2004-05-03
upup再up
  • 打赏
  • 举报
回复
ervinlj 2004-05-03
没有啊,没有method=post这句话呀!!!
  • 打赏
  • 举报
回复
ervinlj 2004-05-02
我尝试过了,还是出现了这个问题,问题中<action>的name属性为EmpForm只是我的一个打字错误,看来问题还不是出现在这里,请各位高人再帮我看看!!!谢谢!!!
  • 打赏
  • 举报
回复
crazycy 2004-05-02
我也是初学者
刚刚解决了这个问题
很高兴能与你一起交流 我的QQ:33682690
  • 打赏
  • 举报
回复
crazycy 2004-05-02
请把你的struts-config.xml中
action标签的name属性值换为form-bean的name属性值
即:
<struts-config>
<form-beans>
<form-bean name="empForm" type="com.example.EmpForm" />
</form-beans>
<action-mappings>
<action path="/empaction"
type="com.example.EmpAction"
name="empForm"
scope="request"
input="/inputContent.jsp">
<forward name="success" path="/outputContent.jsp">
</action>
</action-mappings>
</struts-config>
  • 打赏
  • 举报
回复
ervinlj 2004-05-02
出现的完全错误信息如下:
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:479)


root cause

javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
at org.apache.jsp.inputContent_jsp._jspService(inputContent_jsp.java:97)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:479)



--------------------------------------------------------------------------------

Apache Tomcat/4.1.24
快点帮我看看如何来解决这个问题呢?
  • 打赏
  • 举报
回复
相关推荐
发帖
Web 开发
加入

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2004-05-02 04:13
社区公告
暂无公告