日期:2014-05-17  浏览次数:20652 次

数组存储问题 SSH 后台怎样存储
本帖最后由 Simpellife 于 2012-12-07 11:14:24 编辑 <tr>
<td width="15%" align="center" class="alt"><span>商品名称</span></td>
<td align="center" colspan="3" class="alt"><span>问题详细</span></td>
</tr>
<tr>
<td width="15%" >
<input  type="text" class="input5" size="30" name="proList[0].productName" value=""/>
</td>
<td colspan="3" >
<input  type="text" class="input5" size="180" name="proList[0].problemDetail" value=""/>
</td>
</tr>

js code:
var i=1;
function addRow(){ 
var newTr = table2.insertRow(); 
var newTd0 = newTr.insertCell();
var newTd1 = newTr.insertCell();
newTd0.innerHTML ='<td align="center"><input name="proList['+i+'].productName" type="text" class="input5" size="30" value=""/></td>';  
newTd1.innerHTML= '<td colspan="3" ><input name="proList['+i+'].problemDetail" type="text" class="input5" size="180" value=""/></td>'; 
i++;
}
------解决方案--------------------
ll想问什么啊
------解决方案--------------------
 没明白 
------解决方案--------------------
引用:
ll想问什么啊


我想问的是 我前台的这种写法怎么通过后台存储起来

------解决方案--------------------
用表单提交给action,然后保存就行了。
------解决方案--------------------
引用:
用表单提交给action,然后保存就行了。


能存进去我还用问吗?
------解决方案--------------------
怎么办不用list啊
------解决方案--------------------
引用:
怎么办不用list啊

我想用list 可是不知道后台怎么把list存起来 求例子!!!
------解决方案--------------------
你后台的action属性要有一个List<Product> proList
然后,要提供set方法、get方法
你前台的要提供的这些数据要放在form表单中
------解决方案--------------------
引用:
你后台的action属性要有一个List<Product> proList
然后,要提供set方法、get方法
你前台的要提供的这些数据要放在form表单中


是的我也是这样放的 可是存不进去 返回的list是个空的 检查了name值没有写错
------解决方案--------------------
后台action定义属性 给set,get方法
------解决方案--------------------
null