Cannot find ActionMappings or ActionFormBeans collection,實在是搞不定了

airhork發表於2005-12-18
struts的最簡單的程式
老是報錯Cannot find ActionMappings or ActionFormBeans collection
快一天了,實在不知道哪裡錯了,大家幫忙呀

我用的是jdkj2sdk1.4.2_09,eclipse3.1.0 myeclipse 4.0gae31

struts的配置檔案是:


<?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="FirstForm" type="com.airhork.struts.form.FirstForm" />

</form-beans>

<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="FirstForm"
input="/form/first.jsp"
name="FirstForm"
path="/first"
scope="request"
type="com.airhork.struts.action.FirstAction" >

<forward name="success" path = "/success.jsp"/>
</action>

</action-mappings>

<message-resources parameter="com.airhork.struts.ApplicationResources" />
</struts-config>
<p class="indent">



web.xml為:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<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>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<p class="indent">


firstjsp為

<%@ page language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<html>
<head>
<title>JSP for firstForm form</title>
</head>
<body>
<html:form action="/first.do">
length : <html:text property="length"/><html:errors property="length"/><br/>
username : <html:text property="username"/><html:errors property="username"/><br/>
<html:submit/><html:cancel/>
</html:form>
</body>
</html>

FirstAction就是轉移了個頁面
return mapping.findForward("success");

實在不知道怎麼辦了,幫忙呀

相關文章