仔细检查了一下,不知错在哪里
我的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/j2ee/dtds/web-app_2_3.dtd"> 
<web-app> 
<display-name>Struts Logon Application</display-name> 
<!-- Standard Action Servlet Configuration (with debugging) --> 
<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> 
<load-on-startup>2</load-on-startup> 
</servlet> 
<!-- Standard Action Servlet Mapping --> 
<servlet-mapping> 
<servlet-name>action</servlet-name> 
<url-pattern>*.do</url-pattern> 
</servlet-mapping> 
<!-- The Welcome File List --> 
<welcome-file-list> 
<welcome-file>logon.jsp</welcome-file> 
</welcome-file-list> 
<!-- Struts Tag Library Descriptors --> 
<taglib> 
<taglib-uri>/tags/struts-bean</taglib-uri> 
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location> 
</taglib> 
<taglib> 
<taglib-uri>/tags/struts-html</taglib-uri> 
<taglib-location>/WEB-INF/struts-html.tld</taglib-location> 
</taglib> 
<taglib> 
<taglib-uri>/tags/struts-logic</taglib-uri> 
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location> 
</taglib> 
<taglib> 
<taglib-uri>/tags/struts-nested</taglib-uri> 
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location> 
</taglib> 
<taglib> 
<taglib-uri>/tags/struts-tiles</taglib-uri> 
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location> 
</taglib> 
</web-app>
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="logonForm" type="com.logon.app.LogonForm"/> 
</form-beans> 
<action-mappings> 
<action 
path="/Logon" type="com.logon.app.LogonAction" name="logonForm" scope="request" input="Logon.jsp"> 
<forward name="success" path="/success.jsp"/> 
<forward name="failure" path="/Logon.jsp"/> 
</action> 
<message-resources parameter="resources.application"/> 
</struts-config>

解决方案 »

  1.   

    你的jsp文件action中是不是写错了,注意大小写
      

  2.   

    logon.jsp文件内容:
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ page contentType="text/html; charset=gb2312" %> 
    <% 
    /** 
    * This page shows Logon interface. 
    * Title: LOGON SYSTEM 
    * Description: Logon Page 
    * Copyright: Copyright (c) 2004 
    * Company: www.ewe.com.cn 
    * @author bluesunny <[email protected]
    * @version 1.0 
    */ 
    response.setHeader("Pragma","No-cache"); 
    response.setHeader("Cache-Control","no-cache"); 
    response.setDateHeader("Expires", 0); 
    %> 
    <html> 
    <head> 
    <title>Logon</title> 
    </head> 
    <body> 
    <html:errors/> 
    <html:form action="/Logon" focus="username"> 
    username:<html:text property="username" size="25"/> 
    password:<html:password property="password" size="25"/> 
    <html:submit property="submit"/> 
    </html:form>  </body> 
    </html>
      

  3.   

    补充说一下,我是打开logon.jsp的时候就报的错
      

  4.   

    表示path的属性值前面加上/试试,再就是注意大小写的问题
      

  5.   

    <html:form action="/Logon.do" focus="username">如此改
      

  6.   

    看花了眼,配置文件弄错了。
    <action-mappings>没有封闭