正在加载图片...
guokehua(@yahoo.com.cn ActionForn高级应用3: 利用索引属性的 ActionForn 第一步:表单上表单元素的 property叫做: 属性名,从0开始 1010 <html: text property="phone [0]"></html: text> <html: text property="phone [1]"></html: text> <html: text property="phone [2]"></html: text> ·第二步:在 ActionForm中定义一个数组存储 Q这些属性,增加se和get函数 private string[] phones new String [3]i public string getPhone (int i)i return phones [i]i public void setPhone(int i, string phone)i this phones [i]= phone 008-3-10 郭克华JEE框架实战教学视频2008-3-10 5 J guokehua@yahoo.com.cn 郭克华J2EE框架实战教学视频 ActionForm ActionForm高级应用3: 利用索引属性的 利用索引属性的ActionForm ActionForm • 第一步:表单上表单元素的 第一步:表单上表单元素的property property叫做: 属性名[i],i从0开始 <html:text html:text property property="phone[0]" "phone[0]"></html:text html:text> <html:text html:text property property="phone[1]" "phone[1]"></html:text html:text> <html:text html:text property property="phone[2]" "phone[2]"></html:text html:text> • 第二步:在ActionForm ActionForm中定义一个数组存储 中定义一个数组存储 这些属性,增加 这些属性,增加set和get函数 private private String[] String[] phones = new String[3]; String[3]; public String getPhone getPhone(int i){ return phones[i]; } public void setPhone setPhone(int i,String phone){ i,String phone){ this.phones[i] = phone; [i] = phone; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有