RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
Hi Chris, >How will this help? I thought you said that your action code wasn't >being executed. If that's the case, then it will still bomb before you >get a chance to call get(String,int). this method is (eventually) called as part of the processPopulate (its what fails)...but unfortunately it doesnt seem to be designed for overriding. >Is this because poking something into "foo[3]" will auto-expand in a >LazyDynaBean? correct, it fills the array (from current size to index) with a LazyDynaBean (by default) - this bean can have any property set. >I'm not sure how this helps at all. Can you describe why you think this >will work? if the form is on the session, struts doesn't construct a new one - so we still have the original array (on the form), which can be accessed and updated with the request parameters - *but* theres an assumption that exactly the same number of request params will be submitted. I'm not sure the implications are fully understood by many users...including me until now (thanks Urso) >If you have a multi-page flow that expects your form bean to continue to >hold information from past pages, then you will certainly need to store >the bean in the session. If this is a one-page form submission, then I'm >not sure why the choice of bean scope is relevant. there are many choices...:) >How is this different from your existing setup? well, firstly there is no such attribute as "indexedBean" - but if there was struts could instantiate it and populate the property (sort of how LazyValidatorForm works). Paul From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Sat 9/12/2006 3:52 AM To: Struts Users Mailing List Subject: Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: >> Have you tried calling yourFormBean.get("yourArrayList") and >> checking to see what it inside of it? > > not sure what you mean - the action method is never called as the > RequestProcessor cant populate the DynaForm from http request > parameters... Oh... so it bombs in populatePopulate before your Action.execute is called? Hmm... > I think the solution (for DynaForm on request scope) is: > a) override the get(String,int) method (is dynamic="true" required?) How will this help? I thought you said that your action code wasn't being executed. If that's the case, then it will still bomb before you get a chance to call get(String,int). > b) use LazyValidatorForm (or/with LazyDynaBean) Is this because poking something into "foo[3]" will auto-expand in a LazyDynaBean? > c) put the form on session I'm not sure how this helps at all. Can you describe why you think this will work? If you have a multi-page flow that expects your form bean to continue to hold information from past pages, then you will certainly need to store the bean in the session. If this is a one-page form submission, then I'm not sure why the choice of bean scope is relevant. > d) include a new mapping attribute ;) e.g. name="items" type="java.util.ArrayList" > indexedBean="com.example.MyBean" /> How is this different from your existing setup? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org <http://enigmail.mozdev.org/> iD8DBQFFeZhG9CaO5/Lv0PARAv1KAJsH9k0vAqGWb9zH/K9vKQXbmymO3wCeNtg6 MK7aLdO7GI5+2v4/mq22kZ0= =QSGv -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: >> Have you tried calling yourFormBean.get("yourArrayList") and >> checking to see what it inside of it? > > not sure what you mean - the action method is never called as the > RequestProcessor cant populate the DynaForm from http request > parameters... Oh... so it bombs in populatePopulate before your Action.execute is called? Hmm... > I think the solution (for DynaForm on request scope) is: > a) override the get(String,int) method (is dynamic="true" required?) How will this help? I thought you said that your action code wasn't being executed. If that's the case, then it will still bomb before you get a chance to call get(String,int). > b) use LazyValidatorForm (or/with LazyDynaBean) Is this because poking something into "foo[3]" will auto-expand in a LazyDynaBean? > c) put the form on session I'm not sure how this helps at all. Can you describe why you think this will work? If you have a multi-page flow that expects your form bean to continue to hold information from past pages, then you will certainly need to store the bean in the session. If this is a one-page form submission, then I'm not sure why the choice of bean scope is relevant. > d) include a new mapping attribute ;) e.g. name="items" type="java.util.ArrayList" > indexedBean="com.example.MyBean" /> How is this different from your existing setup? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFeZhG9CaO5/Lv0PARAv1KAJsH9k0vAqGWb9zH/K9vKQXbmymO3wCeNtg6 MK7aLdO7GI5+2v4/mq22kZ0= =QSGv -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
Chris, >So, you have type="java.util.ArrayList" in your form bean definition? Yes >Are you sure that Struts knows how to handle that? Yes, it creates a new (empty) arraylist >Have you tried calling yourFormBean.get("yourArrayList") and checking to >see what it inside of it? not sure what you mean - the action method is never called as the RequestProcessor cant populate the DynaForm from http request parameters... I think the solution (for DynaForm on request scope) is: a) override the get(String,int) method (is dynamic="true" required?) b) use LazyValidatorForm (or/with LazyDynaBean) c) put the form on session d) include a new mapping attribute ;) e.g. thanks for your responses...I hope Urso is happy too! Cheers, Paul From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Sat 9/12/2006 3:24 AM To: Struts Users Mailing List Subject: Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: > Chris, In my DynForm I'm actually using a java.util.ArrayList > (contains my bean objects). So, you have type="java.util.ArrayList" in your form bean definition? Are you sure that Struts knows how to handle that? It might just be creating a new ArrayList for your bean property and then not going anything after that. Have you tried calling yourFormBean.get("yourArrayList") and checking to see what it inside of it? > the http request contains properties: > checkList[0].resultId=34&checkList[1].resultId=45 etc Okay, I have my form submitting multiple "addQuestionId" parameters with no specific subscripts. Perhaps you are trying to do something slightly differently than I am. Apologies if I missed the point. > Dumb question: - assuming your String[] is empty when the > processPopulate starts, what is the code to grow it to accomodate a > variable number of http request parameters? I don't have to worry about it... Struts handles parsing the request parameters and setting up the array entirely. I merely call getStrings() on my dyna form bean and I get the data. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org <http://enigmail.mozdev.org/> iD8DBQFFeZG59CaO5/Lv0PARAv2OAKCCllzEmXCL5mdJAMwnXCJquMwvSQCdEXvX c5UsdhF01rQCoBc88rt2RsU= =K+l5 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: > Chris, In my DynForm I'm actually using a java.util.ArrayList > (contains my bean objects). So, you have type="java.util.ArrayList" in your form bean definition? Are you sure that Struts knows how to handle that? It might just be creating a new ArrayList for your bean property and then not going anything after that. Have you tried calling yourFormBean.get("yourArrayList") and checking to see what it inside of it? > the http request contains properties: > checkList[0].resultId=34&checkList[1].resultId=45 etc Okay, I have my form submitting multiple "addQuestionId" parameters with no specific subscripts. Perhaps you are trying to do something slightly differently than I am. Apologies if I missed the point. > Dumb question: - assuming your String[] is empty when the > processPopulate starts, what is the code to grow it to accomodate a > variable number of http request parameters? I don't have to worry about it... Struts handles parsing the request parameters and setting up the array entirely. I merely call getStrings() on my dyna form bean and I get the data. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFeZG59CaO5/Lv0PARAv2OAKCCllzEmXCL5mdJAMwnXCJquMwvSQCdEXvX c5UsdhF01rQCoBc88rt2RsU= =K+l5 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
I should have mentioned the get(String, int) is called to get the business object (bean) from the array, so it can then set the property. Since the array is empty it fails with any index. The only solution I can see is to override this method or use LazyValidatorForm (LazyDynaBean). Is there a recommended solution? From: Strachan, Paul [mailto:[EMAIL PROTECTED] Sent: Sat 9/12/2006 2:54 AM To: Struts Users Mailing List Subject: RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? Chris, In my DynForm I'm actually using a java.util.ArrayList (contains my bean objects). the http request contains properties: checkList[0].resultId=34&checkList[1].resultId=45 etc I havn't debugged using a String[] but the BeanUtilsBean.populate method works differently with properties. I'm not sure the best approach to handle an empty arraylist, but the point is you still have to do *something* - I'm just not sure what. Dumb question: - assuming your String[] is empty when the processPopulate starts, what is the code to grow it to accomodate a variable number of http request parameters? Thanks, Paul From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Sat 9/12/2006 1:27 AM To: Struts Users Mailing List Subject: Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: > A request scoped "out of the box" DynaValidatorForm is also unable to > handle indexed properties e.g. throws IndexOutOfBoundsException in > DynaActionForm.get(string, int) I've never used get(String, int), but I use request-scoped indexed properties all the time and use getStrings(String) just fine in that case. My setup in struct-config.xml: Part of my form-handler action: // Add and remove the appropriate questions. List questions = getQuestionList(existingQuestions, questionSetForm.getStrings("addQuestionId"), questionSetForm.getStrings("deleteQuestionId")); If you are getting IndexOutOfBoundsException, then your loop might be running too long. How are you determining what the maximum index is that you can use? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org <http://enigmail.mozdev.org/> <http://enigmail.mozdev.org/> iD8DBQFFeXZH9CaO5/Lv0PARAk8cAKDAtrEWWH1nl34JU75mKkGfh+IPswCffh6X 56p3VYmREkJLNH5by0RVysM= =yUyl -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
Chris, In my DynForm I'm actually using a java.util.ArrayList (contains my bean objects). the http request contains properties: checkList[0].resultId=34&checkList[1].resultId=45 etc I havn't debugged using a String[] but the BeanUtilsBean.populate method works differently with properties. I'm not sure the best approach to handle an empty arraylist, but the point is you still have to do *something* - I'm just not sure what. Dumb question: - assuming your String[] is empty when the processPopulate starts, what is the code to grow it to accomodate a variable number of http request parameters? Thanks, Paul From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Sat 9/12/2006 1:27 AM To: Struts Users Mailing List Subject: Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: > A request scoped "out of the box" DynaValidatorForm is also unable to > handle indexed properties e.g. throws IndexOutOfBoundsException in > DynaActionForm.get(string, int) I've never used get(String, int), but I use request-scoped indexed properties all the time and use getStrings(String) just fine in that case. My setup in struct-config.xml: Part of my form-handler action: // Add and remove the appropriate questions. List questions = getQuestionList(existingQuestions, questionSetForm.getStrings("addQuestionId"), questionSetForm.getStrings("deleteQuestionId")); If you are getting IndexOutOfBoundsException, then your loop might be running too long. How are you determining what the maximum index is that you can use? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org <http://enigmail.mozdev.org/> iD8DBQFFeXZH9CaO5/Lv0PARAk8cAKDAtrEWWH1nl34JU75mKkGfh+IPswCffh6X 56p3VYmREkJLNH5by0RVysM= =yUyl -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: > A request scoped "out of the box" DynaValidatorForm is also unable to > handle indexed properties e.g. throws IndexOutOfBoundsException in > DynaActionForm.get(string, int) I've never used get(String, int), but I use request-scoped indexed properties all the time and use getStrings(String) just fine in that case. My setup in struct-config.xml: Part of my form-handler action: // Add and remove the appropriate questions. List questions = getQuestionList(existingQuestions, questionSetForm.getStrings("addQuestionId"), questionSetForm.getStrings("deleteQuestionId")); If you are getting IndexOutOfBoundsException, then your loop might be running too long. How are you determining what the maximum index is that you can use? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFeXZH9CaO5/Lv0PARAk8cAKDAtrEWWH1nl34JU75mKkGfh+IPswCffh6X 56p3VYmREkJLNH5by0RVysM= =yUyl -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
Hi, I've only recently started putting my forms on request scope, and encountered this issue with DynaValidatorForm. A request scoped "out of the box" DynaValidatorForm is also unable to handle indexed properties e.g. throws IndexOutOfBoundsException in DynaActionForm.get(string, int) - I guess this is just one of those Struts "quirks" encountered from time to time. My actual form extends DynaValidatorForm so I suppose I could override this method and populate the array with my object type (see how LazyValidatorForm does it). Perhaps the struts indexed properties documentation could improve how various form implementations should "grow" arrays. This exercise has taught me that having the form on session scope won't necessarily solve the problem...ie if more http params are posted than the array size. Cheers, Paul p.s. for a DynaForm the request parameters are passed through a Map so the form List is not populated in any particular order - although it matches the http request params exactly when its completed. I havn't worked with ActionForms so that may be the case there too - but I'd keep the form at request scope. From: Urso Wieske [mailto:[EMAIL PROTECTED] Sent: Fri 8/12/2006 7:58 PM To: user@struts.apache.org Subject: FW: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? Hi folks, Unfortunately I have not got any reactions about my statement yet? I really would like to hear some views on this matter. Kind Regards Urso Wieske -Oorspronkelijk bericht- Van: Urso Wieske Verzonden: donderdag 7 december 2006 14:11 Aan: 'Struts Users Mailing List' Onderwerp: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? Hi folks, Very low reactions on my posting about indexed properties, form, beanutils and request scope. I therefore impose the following CHALLENGE STATEMENT: "Indexed Properties can not be used with FORMS on REQUEST scope!" I am curious to know who is able to support or reject this statement, beceause until now I was not able do implement this scenario without exceptions. Ted Husted: I would really like your view on the above... :-) Kind regards Urso Wieske - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
I did'nt see your code in your posting but if you're looking for an example for using Indexed Properties please reference http://struts.apache.org/1.x/struts-taglib/indexedprops.html M- --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: "Urso Wieske" <[EMAIL PROTECTED]> To: Sent: Friday, December 08, 2006 3:58 AM Subject: FW: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? Hi folks, Unfortunately I have not got any reactions about my statement yet? I really would like to hear some views on this matter. Kind Regards Urso Wieske -Oorspronkelijk bericht- Van: Urso Wieske Verzonden: donderdag 7 december 2006 14:11 Aan: 'Struts Users Mailing List' Onderwerp: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? Hi folks, Very low reactions on my posting about indexed properties, form, beanutils and request scope. I therefore impose the following CHALLENGE STATEMENT: "Indexed Properties can not be used with FORMS on REQUEST scope!" I am curious to know who is able to support or reject this statement, beceause until now I was not able do implement this scenario without exceptions. Ted Husted: I would really like your view on the above... :-) Kind regards Urso Wieske - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
Hi folks, Unfortunately I have not got any reactions about my statement yet? I really would like to hear some views on this matter. Kind Regards Urso Wieske -Oorspronkelijk bericht- Van: Urso Wieske Verzonden: donderdag 7 december 2006 14:11 Aan: 'Struts Users Mailing List' Onderwerp: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? Hi folks, Very low reactions on my posting about indexed properties, form, beanutils and request scope. I therefore impose the following CHALLENGE STATEMENT: "Indexed Properties can not be used with FORMS on REQUEST scope!" I am curious to know who is able to support or reject this statement, beceause until now I was not able do implement this scenario without exceptions. Ted Husted: I would really like your view on the above... :-) Kind regards Urso Wieske - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
Hi folks, Very low reactions on my posting about indexed properties, form, beanutils and request scope. I therefore impose the following CHALLENGE STATEMENT: "Indexed Properties can not be used with FORMS on REQUEST scope!" I am curious to know who is able to support or reject this statement, beceause until now I was not able do implement this scenario without exceptions. Ted Husted: I would really like your view on the above... :-) Kind regards Urso Wieske - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]