我的页面代码是:
<logic:iterate indexId="index" id="info" name="modelReviewInfoForm" property="pageResult.list" type="org.jb.y272.team0.entity.ModelReviewInfo">
<tr>
    <html:file   size="10"  property="imgsReview"></html:file> </td>
</tr>
</logic:iterate>
这样子会显示多张图片。
我想一下子将多张图片一起修改了。
求高手指教。最好能加我Q指教。136522152
小弟新手

解决方案 »

  1.   

    在action里面获得所有的图片  然后再逐步上传到服务器
      

  2.   

    在*.xml中 
    < s:form action ="doMultipleUploadUsingList" method ="POST" enctype ="multipart/form-data" > 
        < s:file label ="File (1)" name ="upload" /> 
        < s:file label ="File (2)" name ="upload" /> 
        < s:file label ="FIle (3)" name ="upload" /> 
        < s:submit /> 
    </ s:form > 然后再*.jsp中用struts2的上传机制······跟传一个差不多~~~ 
      

  3.   

    看一下这个网址    http://www.duduwolf.com/wiki/2007/334.html
      

  4.   

    问题自己解决了,说一下我的做法:
    用的是ssh框架 Form里面定义一个private List<FormFile> imgList=new ArrayList<FormFile>();list集合
    页面:<logic:iterate indexId="index" id="info" name="modelReviewInfoForm" property="pageResult.list" type="org.jb.y272.team0.entity.ModelReviewInfo">
      <td valign="top" class="data_cell"><html:file onfocus="javascript:LinkInfo('${index }')" size="10" property="imgList(${index})"></html:file> </td>
    </logic:iterate >
    action:
    public ActionForward doEdit(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) throws IOException, ParseException {
    ModelReviewInfoForm modelReviewInfoForm = (ModelReviewInfoForm) form;// TODO Auto-generated method stub
      MultipartRequestHandler multipartRequestHandler = form.getMultipartRequestHandler();
    Hashtable elements = multipartRequestHandler.getFileElements();
    Collection values = elements.values(); 
    for (java.util.Iterator i = values.iterator(); i.hasNext();) {
    FormFile file = (org.apache.struts.upload.FormFile) i.next();// 取得上传的文件
    if(!"".equals(file.toString())&&file.toString()!=null){
    fname= file.getFileName();// 获取文件名
    fname=editFileName(fname);
    FileOutputStream fileOutput;
    //圖片存儲路徑
    String fileUrl=this.getServlet().getServletContext().getRealPath("//images//ModelImages//" +fname);
    //String fileUrl=request.getRealPath("//back//photo//graph//" + file.getFileName());
    //寫入圖片流
    fileOutput=new FileOutputStream(fileUrl);
    fileOutput.write(file.getFileData());
    fileOutput.flush();
    fileOutput.close();
    }
    }
    return null;
    }
    代码简单的帖了一些。。没帖全