1
여러 파일을 서버에 업로드해야합니다. 내가 다음 코드 JSP를 썼다 :스트럿츠로 여러 파일 업로드 1
<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>
의 ActionForm :
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
하지가 필요하십니까? –
무슨 뜻인지 몰랐습니까? – fatiDev
특별한 파일 배열을 소개합니다. FormFile image0 및 image1을 개선하십시오. (Struts는 오랫동안 잊혀진 것입니다.) 하나의 FormFile로 만들 수 있다면 두 번째는 간단해야합니다. –