配置struts-config.xml文件
1.多个Action中配置同一个form
2.将form的生存范围设置成session级

解决方案 »

  1.   

    Mark下,请问二楼的两种方法怎么实现
    刚学Structs,不好意思~
      

  2.   

    不是两种方法,是两个步骤
    配置struts-config.xml,例:
    <form-beans>
      <form-bean name="testForm" type="test.TestForm"/>
    </form-beans>
    <action-mappings>
             <action
             path="/test1"
             type="test.Action1"
             scope="session"//设置form的生存范围,也可以不写,默认为session
             validate="false"       
             input="/test1.jsp"
             name="testForm">//设置actionform为testForm         <action
             path="/test2"
             type="test.Action2"
             scope="session"//设置form的生存范围,也可以不写,默认为session
             validate="false"       
             input="/test2.jsp"
             name="testForm">//设置actionform为testForm
    </action-mappings>