请问为何我配置了ActionMappings和ActionFormBeans在载入页面,还会报这个错误呢?马上给分,祝节日愉快
各位网友,大家好:
小弟我初学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