我需要将多个文件上传到服务器。我写了以下代码jsp:
<form action="fileUpload.do" method="post" enctype="multipart/form-data">
<input type="file" name="image" />
<input type="file" name="image" />
</div>
</div>
<input type="submit" value="submit">
</form>
行动形式:
public class UploadForm extends ActionForm {
private FormFile[] image = new FormFile[2] ;
public FormFile[] getImage() {
return image;
}
public void setImage(FormFile[] image) {
this.image = image;
}
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
return null;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
它给了我这个错误
java.lang.IllegalArgumentException: argument type mismatch