日期:2014-05-18  浏览次数:20623 次

struts2、Spring3.0、mybatis整合问题,求助~~~~~~~~~求助~~~~~~~~~
想做一个批量提交插入数据库,不过老是报空指针,求大神帮忙瞅瞅,下面贴代码
JSP代码:
<s:iterator value="listTmManage" status="s">
  <tr class="row" onmouseover="this.className='overrow'" onmouseout="this.className='row'" align="center">
  <input type="hidden" name="tmManageExs[<s:property value="#s.index" />].id" />
      <td><s:property value="#s.index+1" /></td>
      <td><input type="text" id="tmmanageex.tm_id" name="tmManageExs[<s:property value="#s.index" />].tm_id" value="<s:property value="id" /> "/></td>
      <td><input type="text" id="tmmanageex.tz_id" name="tmManageExs[<s:property value="#s.index" />].tz_id" value="<s:property value="tz_id" />"/></td>
      <td><input type="text" id="tmmanageex.record_id" name="tmManageExs[<s:property value="#s.index" />].record_id" value="${tzmanageex.record_id}" /></td> 
      <td align="left"><s:property value="tm_title" /></td>
      
      <td><input type="radio" id="tmmanageex.score" name="tmManageExs[<s:property value="#s.index" />].score" value="1" /> </td>
      <td><input type="radio" id="tmmanageex.score" name="tmManageExs[<s:property value="#s.index" />].score" value="2" /> </td>
      <td><input type="radio" id="tmmanageex.score" name="tmManageExs[<s:property value="#s.index" />].score" value="3" /> </td>
      <td><input type="radio" id="tmmanageex.score" name="tmManageExs[<s:property value="#s.index" />].score" value="4" /> </td>
      <td><input type="radio" id="tmmanageex.score" name="tmManageExs[<s:property value="#s.index" />].score" value="5" /> </td> 
   </tr>
   
  </s:iterator>

Action

public String subscore() throws Exception{
  for(TmManageEx tmmanageex : tmManageExs){
  this.tmManageExService.saveTmManageEx(tmmanageex, this.getUserInfo());
  }
  
       if (UtilAPI.isNull(tmmanageex)){throw new BusinessException("找不到该记录");}
      return SUCCESS; 
  }