当前位置: 代码迷 >> Java Web开发 >> 数组存储有关问题 SSH 后台怎样存储
  详细解决方案

数组存储有关问题 SSH 后台怎样存储

热度:3925   发布时间:2013-02-25 21:08:05.0
数组存储问题 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想问什么啊用表单提交给action,然后保存就行了。后台action定义属性 给set,get方法
引用:
用表单提交给action,然后保存就行了。


能存进去我还用问吗?你后台的action属性要有一个List<Product> proList
然后,要提供set方法、get方法
你前台的要提供的这些数据要放在form表单中null 没明白 
引用:
你后台的action属性要有一个List<Product> proList
然后,要提供set方法、get方法
你前台的要提供的这些数据要放在form表单中


是的我也是这样放的 可是存不进去 返回的list是个空的 检查了name值没有写错
引用:
ll想问什么啊


我想问的是 我前台的这种写法怎么通过后台存储起来
怎么办不用list啊
引用:
怎么办不用list啊

我想用list 可是不知道后台怎么把list存起来 求例子!!!
  相关解决方案