可能是<html:link forward="logon">Sign in</html:link>
有问题。你把forward换成action试试!

解决方案 »

  1.   

    <%
    String userName = "Bob";
    pageContext.setAttribute("userName", userName);
    %>
    <html:link page="/Edit.do"
    paramId="user" paramName="userName">
    Edit User
    </html:link>
    When this snippet is evaluated, it will result in an HTML snippet similar to the following:
    <a href="/webappname/Edit.do?user=Bob">Edit User</a>
      

  2.   

    forward   Identifies the name of the global forward element that
               will receive control of the forwarded request.(Optional)
    通过上面所说,你的logon必须是全局性的forward
      

  3.   

    <struts-config>  <!-- ========== Form Bean Definitions =================================== -->
       <!-- ========== Global Forward Definitions ============================== -->
       <global-forwards>
          <forward name="logon"      path="/logon.jsp"/>
       </global-forwards>
      <!-- ========== Action Mapping Definitions ============================== -->
      <action-mappings>
    <!-- Process a user logon -->
        <action    path="/logon"
                   type="mystruts.src.logon.LogonAction"
                   name="logonForm"
                   scope="request"
                   input="/logon.jsp"
       parameter="/mystruts/jsp/login.jsp"
      >
        </action>
      </action-mappings></struts-config>
      

  4.   

    path="/logon" ==>path="/logonAction"
      

  5.   

    to zxl19790710(雪龙)
    :
    我将页面简化为
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html>
    <head>
    </head>
    <body>
    <html:link forward="/logon">Sign in</html:link>
    </body>
    </html>struts-config
    <?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
              "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <struts-config>  <!-- ========== Form Bean Definitions =================================== -->
       <!-- ========== Global Forward Definitions ============================== -->
       <global-forwards>
          <forward name="logon" path="/logon.jsp"/>
       </global-forwards>
      <!-- ========== Action Mapping Definitions ============================== -->
     </struts-config>错误:
    javax.servlet.ServletException: Cannot create rewrite URL: java.net.MalformedURLException: Cannot retrieve ActionForwards collection
    这是怎么回事
      

  6.   

    <html:link forward="logon">Sign in</html:link>
    我作了测试一切ok
      

  7.   

    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html>
    <head>
    </head>
    <body>
    <html:link forward="logon">Sign in</html:link>
    </body>
    </html>
    /////////////////////struts
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <struts-config>
      <global-forwards>
        <forward name="logon" path="/logon.jsp"/>
      </global-forwards>
    </struts-config>////////////////////
    <?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>
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>debug</param-name>
          <param-value>2</param-value>
        </init-param>
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</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>
    </web-app>