Hi, all.

I have a question about using indexed properties. I need to have the
user upload some arbitrary (to be dynamically increased via Javascript
while the user is on the form page) number of files as part of a form. I
figured it makes sense to create an indexed property so that then I have
a List<File> in my action whose elements I can then store as needed. I
can't find anything in the documents about how to get Struts to fill in
indexed properties from forms, though. (Well, plenty of Struts1 results
come up, which is why I assume this is possible, but no Struts2
examples.)

So, the question is: what syntax do I need to use to tell Struts2 that
some form elements will all be part of the same property in the action?
Also, are there any inconsistencies between File upload form elements
and others (aside from the need to have the FileUploadInterceptor on
your stack)?

(I also thought maybe I could just implement RequestAware and then get
them all out of the map, but this seems cleaner if it's possible.)

~Dan Allen



___________________________________
The action which would receive the files:
public class DocumentUploadAction extends MidasAction implements
Validateable {
        
        private List<File> docContents = new ArrayList<File>();
        
        
        public void setDocumentFiles(List<File> files) {
                this.docContents = files;
        }
        public List<File> getDocumentFiles() {
                return this.docContents;
        }

        public String execute() {
                // Do some stuff with the files.
        }
}

-- 
This message may contain confidential, proprietary, or legally privileged 
information. No confidentiality or privilege is waived by any transmission to 
an unintended recipient. If you are not an intended recipient, please notify 
the sender and delete this message immediately. Any views expressed in this 
message are those of the sender, not those of any entity within the KBC 
Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the 
part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
recommendation to buy or sell, any financial product. Any prices or other 
values included in this message are indicative only, and do not necessarily 
represent current market prices, prices at which KBC FP would enter into a 
transaction, or prices at which similar transactions may be carried on KBC FP's 
own books. The information contained in this message is provided "as is", 
without representations or warranties, express or implied, of any kind. Past 
performance is not indicative of future returns.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to