struts多层表单提交的问题
scope="request"jsp<logic:iterate id="bean1" name="form" property="list1" indexId="i"><logic:iterate id="bean2" name="bean1" property="list2" indexId="i"><html:text xxxxxxxxxxxxxxxxxxxx></logic:iterate >
</logic:iterate >
form的结构private List<Bean1> list1= new ArrayList<Bean1>();除了get,set,追加方法
public Bean1 getBean1(int index){while(list1.size()<=index){
list1.add(new Bean1());
}
return list1.get(index);
}
Bean1的结构private List<Bean2> list2= new ArrayList<Bean2>();除了get,set,追加方法
public Bean2 getBean2(int index){while(list2.size()<=index){
list2.add(new Bean2());
}
return list2.get(index);
}
画面submit以后,form里面 list1被提交,但是list2丢失,
getBean2这个方法怎么写才能够让list2提交?
scope="request"jsp<logic:iterate id="bean1" name="form" property="list1" indexId="i"><logic:iterate id="bean2" name="bean1" property="list2" indexId="i"><html:text xxxxxxxxxxxxxxxxxxxx></logic:iterate >
</logic:iterate >
form的结构private List<Bean1> list1= new ArrayList<Bean1>();除了get,set,追加方法
public Bean1 getBean1(int index){while(list1.size()<=index){
list1.add(new Bean1());
}
return list1.get(index);
}
Bean1的结构private List<Bean2> list2= new ArrayList<Bean2>();除了get,set,追加方法
public Bean2 getBean2(int index){while(list2.size()<=index){
list2.add(new Bean2());
}
return list2.get(index);
}
画面submit以后,form里面 list1被提交,但是list2丢失,
getBean2这个方法怎么写才能够让list2提交?
解决方案 »
- Eclipse + GWT + googlipse
- 过滤器的经验收集?
- 利用hibernate得到一个对象列表,将对象数据展示在网格中如何处理?
- 请问,访问一个机子的IP就可以访问到tomcat下的项目
- 在text框中输入一个字,会代出相关联的数据
- 菜鸟问题:web层的action中怎么调用业务层?
- 在线等,能帮忙看看吗?jsp中如何备份sql server 2000数据库?
- JSP里是否有mysql_insert_id()或类似功能的函数?(解决就给分)
- 程序员准备创业的请进! 地点:佛山 THE CTO IS WAITING FOR YOU!
- jsp页面中使用iframe导致连接被重置、重复执行两次的奇怪问题!
- 是学好j2ee才能学好JSP
- eWebEditor在线文本编辑器飞鱼修改版 加水印功能
<logic:iterate id="bean1" name="form" property="list1" indexId="i"><logic:iterate id="bean2" name="bean1" property="list2" indexId="j"> <-----笔误,是j<html:text xxxxxxxxxxxxxxxxxxxx></logic:iterate >
</logic:iterate >
<input type="text" name="bean2[1].propery2" value="123">
<input type="text" name="bean2[2].propery3" value="123">