RE: [s2] IndexedProperties set via forms
Wow, in the FAQs, even. My Google-fu is miserable. Thanks/sorry. ~DVA -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 6:02 PM To: Struts Users Mailing List Subject: Re: [s2] IndexedProperties set via forms --- "Allen, Daniel" <[EMAIL PROTECTED]> wrote: > 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 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. http://struts.apache.org/2.x/docs/how-do-we-upload-files.html should cover what you're asking here, I believe. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- 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]
Re: [s2] IndexedProperties set via forms
--- "Allen, Daniel" <[EMAIL PROTECTED]> wrote: > 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 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. http://struts.apache.org/2.x/docs/how-do-we-upload-files.html should cover what you're asking here, I believe. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s2] IndexedProperties set via forms
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 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 docContents = new ArrayList(); public void setDocumentFiles(List files) { this.docContents = files; } public List 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]