Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to upload more than one file in struts?

843836Jul 13 2004 — edited Feb 10 2005
thanks first. I want to upload more than one file at once. So I modify the the example of the struts 1.1. I changed :
protected FormFile theFile;
to
protected FormFile [] theFile;
and add indexed getter and setter method.
public FormFile getTheFileIndexed(int index){
return theFile[index];
}
public void setTehFileIndexed(FormFile theFile,int index){
this.theFile[index]=theFile;
}

and in the upload.jsp, I changed
<html:file property="theFile" />
to
<html:file property="theFile[0]" />

and also in the ActionForm
reset(){
this.theFile=new FormFile[2];
....
}

But when I run it, it tells me there are no getter indexed method.
Thanks again for reading.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2005
Added on Jul 13 2004
4 comments
239 views