隨筆-10  評論-23  文章-32  trackbacks-0

          jsp中,static是一個對象列表:

          <s:iterator value="tacticList" status="tactic">
          <dl>
          <s:hidden name="tacticList[%{#tactic.index}].id" value="%{tacticList[#tactic.index].id}" />
          <s:textfield name="tacticList[%{#tactic.index}].name" value="%{tacticList[#tactic.index].name}"/>:
          <s:set name="list" value="#{'true':'是','false':'否'}" />
          <s:radio list="list" listKey="key" listValue="value" name="tacticList[%{#tactic.index}].value"
          value
          ="%{tacticList[#tactic.index].value}"></s:radio>
          </dl>
          </s:iterator>

          ----------------------------------

          action中,使用一個和jsp中同名的對象列表tacticList,get/set方法,接受提交的數據:

           private List<OMDefaultTactic> tacticList;

          public List<OMDefaultTactic> getTacticList() {
          return tacticList;
          }

          public void setTacticList(List<OMDefaultTactic> tacticList) {
          this.tacticList = tacticList;
          }
          posted on 2009-08-04 15:56 liuyimx 閱讀(1464) 評論(0)  編輯  收藏 所屬分類: struts2

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 筠连县| 甘肃省| 孟村| 石河子市| 融水| 分宜县| 武山县| 亳州市| 青神县| 古浪县| 侯马市| 定州市| 天台县| 富锦市| 辽中县| 偏关县| 天峻县| 塘沽区| 陇南市| 普宁市| 宁阳县| 广昌县| 普兰店市| 大石桥市| 富源县| 郑州市| 阳城县| 永善县| 清徐县| 嘉禾县| 平和县| 海口市| 项城市| 拜城县| 休宁县| 错那县| 呼和浩特市| 邳州市| 利津县| 胶南市| 新丰县|