报错:
javax.servlet.ServletException:Cannot find ActionMappings or ActionFormBeans collection
我排除了几种可能,最后认为是struts-config.xml文件的ActionMapping,form-bean的问题但是找不出来,请大家帮忙!
1.目录为:
|--jsp---login.jsp
Task---|
| |-- classes-- action--Login.class
|--WEB-INF--|-- config-- struts-config.xml
|-- lib-- …………
|-- web.xml
|-- ………… *.tld
2.struts-config.xml文件:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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>
<form-beans>
<form-bean name="loginForm" type="form.LoginForm"/>
</form-beans>
<action-mappings>
<action path="/loginForm1"
type="action.Login"
name="loginForm"
scope="session"
validate="true"
input="/jsp/login.jsp" >
</action>
</action-mappings>
</struts-config>
3.web.xml文件:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>org.apache.struts.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/config/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>