跟用html的一样,
如果你不想把数据都放在源文件里
那么
在第一个表单onChange的时候,
提交表单
后台去数据库读要联动的下拉菜单的数据
然后刷新页面就行了

解决方案 »

  1.   

    同意楼上的,根普通的asp,jsp联动不是一个道理吗?
      

  2.   

    哦..那好弄..页面上的属性都用同一个ActionFrom中的.在页面上.当有onChange事件的时候,将表单提交,到Action然后返回到当前页面...
    你试试..
    index.jsp
    ..
    <html:form method="post" action="modelAction">
    <br><br>
      <html:text property="str1"/>
      <html:text property="str2"/>
      <html:text property="str3"/>
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" value="Reset">
    </html:form>
    ...
    ModelActionForm.java
    .... 
      private String str1;
      private String str2;
      private String str3;
    .....
    ModeAction.java
    ..
    ModelActionForm modelActionForm = (ModelActionForm) actionForm;
    ...
            return actionMapping.findForward("success");
    ...struts-config.xml
    ...
      <form-beans>
        <form-bean name="modelActionForm" type="com.kai.form.ModelActionForm" />
      </form-beans>
      <action-mappings>
        <action name="modelActionForm" path="/modelAction" scope="request" type="com.kai.action.ModelAction">
          <forward name="success" path="/index.jsp" />
        </action>
      </action-mappings>
    ....
      

  3.   

    同理..不管你跳哪个页面.只要设置ActionForm中的属性,struts就会替你保存信息,,
    你先试一下体会体会....不明白再问我...
      

  4.   

    我现在用xml+javascript做下拉列表联动
    我加了一个<html:text property="dwmc" /><span style="width:18">      <html:select property="dwmclist" onchange="deptIDChanged(dept,this)">
              <html:option value="" >&nbsp;</html:option>
              <html:options collection="alldeptlist" property="mc" labelProperty="mc"/>
           </html:select></span>
    有没有只用下面部分就可以实现的方法
    <html:select property="dwmclist" onchange="deptIDChanged(dept,this)">
              <html:option value="" >&nbsp;</html:option>
              <html:options collection="alldeptlist" property="mc" labelProperty="mc"/>
    </html:select>
      

  5.   

    晕..
    html
    javascript的问题也来这问