Path Welcome.do does not start with a "/" characterstuts配置文件中的映射路径一定要用“/”作为开头的

解决方案 »

  1.   

    <?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>
      <data-sources />
      <form-beans>
       <form-bean
       name = "LogonForm"
       type = "app.LogonForm"/>
      </form-beans>
      <global-exceptions />
      <global-forwards >
        <forward name="welcome" path="Welcome.do" />
        <forward name="logoff" path="Logoff.do"/>
    <forward name = "logon" path = "Logon.do"></forward>
      </global-forwards>  <action-mappings>
       <action
       path = "/LogonSubmit"
       type = "app.LogonAction"
       name = "LogonForm"
       scope = "request"
       validate = "true"
       input = "/pages/Logon.jsp"
       >
       <forward
       name = "success"
       path = "/pages/Welcome.jsp"
       ></forward>
       </action>
       <action 
    path="/Welcome" 
    type="org.apache.struts.actions.ForwardAction"
    parameter="/pages/Welcome.jsp"/> 
    <action 
    path = "/Logon"
    type = "org.apache.struts.actions.ForwardAction"
    parameter = "/pages/Logon.jsp"/>
    <action 
    path = "/Logoff"
    type = "org.apache.struts.actions.ForwardAction"
    parameter = "/pages/Welcome.jsp"/>
      </action-mappings>
      <message-resources parameter="app.ApplicationResources" />
    </struts-config>这个是我的配置文件,再帮我看看,好么?infowain
      

  2.   

    <?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 -->    <form-beans>        <form-bean
                name="logonForm"
                type="app.LogonForm"/>    </form-beans>
    <!-- =================================== Global Forward Definitions -->    <global-forwards>
            <forward
                name="logoff"
                path="/Logoff.do"/>
            <forward
                name="logon"
                path="/Logon.do"/>
            <forward
                name="welcome"
                path="/Welcome.do"/>
        </global-forwards>
    <!-- =================================== Action Mapping Definitions -->    <action-mappings>        <action 
                path="/Welcome"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pages/Welcome.jsp"/>        <action 
                path="/Logon"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pages/Logon.jsp"/>        <action 
                path="/LogonSubmit"
                type="app.LogonAction"
                name="logonForm"    
                scope="request"
                validate="true"
                input="/pages/Logon.jsp">
                <forward
                    name="success"
                    path="/pages/Welcome.jsp"/>
            </action>        <action 
                path="/Logoff"
                type="app.LogoffAction">
                <forward
                    name="success"
                    path="/pages/Welcome.jsp"/>
            </action>    </action-mappings>
    <message-resources parameter="app.ApplicationResources" />
    </struts-config>