input type file multiple argument type mismatch

1

I am trying to implement a functionality in which you can upload as many files as you wish to select to the server. I'm doing it with:

<form id="uploadForm" action="uploadFilesDPT.do" styleId="withoutPadding" method="POST" enctype="multipart/form-data" styleClass="withoutPadding">
<input **type="file"** name="theFile" id="attachFiles" onchange="updateSize();" **multiple**/>selected files: <span id="fileNum">0</span>; total size: <span id="fileSize">0</span>

I have the problem in the Bean, if I create an attribute FormFile[] or List<FormFile> , MultipartFile files or MultipartFile[] files :

public class UploadForm extends ActionForm {

/**
 * 
 */
private static final long serialVersionUID = 1L;
private FormFile[] theFile;
private MultipartFile[] files;



public FormFile[] getTheFile() {
    return theFile;
}
public void setTheFile(FormFile[] theFile) {

    this.theFile = theFile;
}    

public void setFiles(MultipartFile[] file) {
    this.files = file;
}

public MultipartFile[] getFiles() {
    return files;
}

}

I always get the same error, how do I solve it?:

  

javax.servlet.ServletException: BeanUtils.populate ", argument type   mismatch.

    
asked by tween 15.06.2016 в 14:49
source

0 answers