Support for multiple file uploads with the same parameter name in one request
-----------------------------------------------------------------------------
Key: STS-265
URL: http://mc4j.org/jira/browse/STS-265
Project: Stripes
Issue Type: Improvement
Components: ActionBean Dispatching
Affects Versions: Release 1.4
Reporter: Tim Fennell
Assigned To: Tim Fennell
Fix For: Release 1.5
>From Gregg Bolinger on the user list:
I am building a page for the user to upload up to 5 images at the same time.
Initially, I had a property for each FileBean in the action bean. imageFile1,
imageFile2, etc. with getters and setters for each. The problem is it's quite
a pain, and a lot of code, to check each one to make sure there is an image
file and then process the file. So I tried doing something like this:
<stripes:file name="imageFiles"/>
<stripes:file name="imageFiles"/>
<stripes:file name="imageFiles"/>
<stripes:file name="imageFiles"/>
<stripes:file name="imageFiles"/>
private FileBean[] imageFiles;
public FileBean[] getImageFiles()
{
return imageFiles;
}
public void setImageFiles(FileBean[] imageFiles)
{
this.imageFiles = imageFiles;
}
However, this did not seem to work. What I would really prefer is something
like this:
<stripes:file name="imageFile"/>
<stripes:file name="imageFile"/>
<stripes:file name="imageFile"/>
<stripes:file name="imageFile"/>
<stripes:file name="imageFile"/>
private List<FileBean> imageFiles;
// getters and setters
and then in my action I can do:
for (FileBean fb : imageFiles)
{
// do all the cool stuff
}
Is there any way to do this currently?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development