为什么我的Struts多模块总是提示:Cannot retrieve mapping for action /loginAction
Henc 2006-04-17 02:27:53 俺是菜鸟,做了一个Struts多模块,但每次都是提示
“Cannot retrieve mapping for action /loginAction”这样的问题,
不知道如何解决,请各位帮下忙,谢谢!
文件结构如下:
\--
|--home
|-- index.jsp
|-- login.jsp
|--WEB-INF
|--class
|-- (*.class文件)
|--home
|-- struts-config.xml
|-- struts-config.xml
|-- web.xml
//---------------------------------------------
//---------------------------------------------
//---------------------------------------------
//**** login.jsp
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<HTML>
<HEAD>
<TITLE></TITLE>
<html:base/>
</HEAD>
<BODY>
<html:form action="/loginAction.do" >
<input type="hidden" name="action" value="login">
<TABLE border="0" width="579" height="408" align="center">
<tr height="85%">
<td></td>
<td></td>
<td></td>
</tr>
<TR>
<TH align="right"><bean:message key="login.jsp.prompt.userID"/></TH>
<td align="left"><html:text property="userID" value=""/></td>
<TH align="left"><bean:message key="login.jsp.prompt.password"/></TH>
<TD align="left"><html:password property="password" value=""/></TD>
<TD align="left">
<html:submit><bean:message key="login.jsp.prompt.submit"/></html:submit>
</TD>
</TR>
</TABLE>
</html:form>
</BODY>
</HTML>
//---------------------------------------------
//---------------------------------------------
//---------------------------------------------
//*** 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>
<display-name>ReportSys</display-name>
<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>config/home</param-name>
<param-value>/WEB-INF/home/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>application</param-name>
<param-value>ApplicationResources</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>
<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>
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
</web-app>
//---------------------------------------------
//---------------------------------------------
//---------------------------------------------
//*** WEB-INF\home\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>
<form-beans>
<form-bean name="LoginForm" type="com.eec.reportsys.safe.form.LoginForm" />
</form-beans>
<action-mappings>
<action name="LoginForm" path="/loginAction" scope="request" type="com.eec.reportsys.safe.action.LoginAction" validate="true" >
<forward name="success" cpath="/index.jsp"/>
<forward name="faile" cpath="/login.jsp"/>
</action>
</action-mappings>
</struts-config>
//---------------------------------------------
//---------------------------------------------
//---------------------------------------------
******************WEB-INF\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>
<global-forwards>
<forward name="home" path="/home/login.jsp" />
</global-forwards>
<message-resources parameter="resources.ApplicationResources" />
</struts-config>
//---------------------------------------------
现在不知道如何实现模块之间的切换,不知道要如何配置,
请各位帮看看如何修改,TKS!