struts错误: Cannot find ActionMappings or ActionFormBeans collection

thklyjj 2004-04-27 09:32:55
使用的是eclipse+MyEclipse插件,oracle数据库,struts-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="logonForm" type="form.LogonForm">
<form-property name="password" type="java.lang.String" />
<form-property name="user" type="java.lang.String" />
</form-bean>
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="logonForm"
input="/logon.jsp"
name="logonForm"
path="/logonAction.do"
type="action.LogonAction" >
<forward name="main" path="/JSP/main.jsp" />
<forward name="lock" path="/JSP/lock.html" />
<forward name="logon" path="/JSP/logon.jsp" />
</action>
</action-mappings>
<controller />
<message-resources parameter="ApplicationResources" />
</struts-config>

web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>Utility.EActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>db-properties</param-name>
<param-value>WEB-INF/db.properties</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>EActionServlet</servlet-name>
<display-name>This is the display name of my J2EE component</display-name>
<description>This is the description of my J2EE component</description>
<servlet-class>Utility.EActionServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>EActionServlet</servlet-name>
<url-pattern>/servlet/EActionServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>logon.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>
logon.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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" %>
<html:html>
<head>
<title>Password Manager System</title>
</head>
<link rel="stylesheet" href="../css/etalk.css" type="text/css">
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" height="90%">
<tr>
<td height="160"></td>
</tr>
<tr>
<td valign="top">
<table width="537" border="0" cellspacing="0" cellpding="0" align="center" background="../pictures/loginbg.gif" height="387">
<html:form action="/logonAction.do">
<tr>
<td width="135">  </td>
<td valign="top" width="402">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height=60>
<div align="center">
<img src="../pictures/spacer.gif" width="1" height="1">
<img src="../pictures/spacer.gif" width="1" height="1"></div>
<div align="center"><img src="../pictures/first_logo_1.gif"></div>
</td>
</tr>
<tr>
<td height=40 colspan="3"> <font color="#ff6100"></font>
</td>
</tr>
<tr>
<td width="23%" >LOGIN ID:</td>
<td width="35%">
<html:text property="user"size="18" maxlength="20" value="" tabindex="1" styleClass="box"/>
<html:errors property="user"/>
</td>
<td width="42%"> </td>
</tr>
<tr>
<td width="23%" height=10>
<img src="../pictures/spacer.gif" width="1" height="1">
<img src="../pictures/spacer.gif" width="1" height="1"></td>
<td width="42%" height=10> </td>
</tr>
<tr>
<td width="23%" >PASSWORD:</td>
<td width="35%">
<html:password property="password" size="18" maxlength="20" value="" tabindex="3" styleClass="box"/><html:errors property="password"/>
</td>
<td width="42%">
<input type="hidden" name="pass" size="20" maxlength="20" value="">
</td>
</tr>
<tr>
<td width="23%" height=50><img src="../pictures/spacer.gif" width="1" height="1"><img src="../pictures/spacer.gif" width="1" height="1"></td>
<td width="35%" height=50> </td>
<td width="42%" height=50> </td>
</tr>
<tr>
<td width="23%" ></td>
<td width="35%">
<div align="right">
<html:image property="submit" src="../pictures/bg_submit.gif" value='Enter'/>
</div>
</td>
<td width="42%"> </td>
</tr>
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="41%" height="30"> </td>
<td width="59%"> </td>
</tr>
<tr>
<td width="41%" height="20"> </td>
<td width="59%"> </td>
</tr>
<tr>
<td width="41%" height="20"> </td>
<td width="59%"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</html:form>
</table>
</td>
</tr>
</table>
</html:html>
运行在tomcat5.0.16下,报错:Cannot find ActionMappings or ActionFormBeans collection,怎么回事儿啊?
...全文
77 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
小光快闪 2004-07-23
把struts.jar放到tomcat安装目录/common/lib下看来还不够,我把jakarta-struts1.1\lib下的所有.jar文件都拷到/common/lib下覆盖了一个common-collections.jar文件,然后启动就好了
回复
thklyjj 2004-04-27
是我扩写的actionServlet在出错,用默认的就可以显示,另外,我想问,取到连接池要写在扩展的action里好,还是写在扩展的servlet里比较好?
回复
thklyjj 2004-04-27
那个logonForm和logonAction是MyEclipse插件自动生成的,生成后,我检查过,是配对的
回复
BillyW 2004-04-27
看STRUTS-CONFIG.XML文件,是否ACTION与FORM配对?
STRUTS-CONFIG里没有logonAction
回复
xu_xinyu 2004-04-27
是什么问题呀,我也遇到了,能告诉我吗???
回复
thklyjj 2004-04-27
错误已经得到纠正,
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

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