I would like to add dynamic HTML input fields on one page, and each of them corresponds to the struts array property element. Say I have several identical fields on an HTML page:
<input type = "file" name = "myfile" / ">
and when the form is submitted, I want each field to correspond to an element in the FormFile array in the form struts bean:
FormFile [] myfile;
Obviously this does not work, but I am looking for how to do something equivalent.
EDIT: The above does not work for uploading files and only of type FormFile.
Otherwise, the array element is intuitively mapped to an input element or an html: text element. So, to clarify my question, why can't I load an array of files using struts?
source share