RE: Logic Iterate in Struts
I am having a problem with this tag as well. My issue it that I set a collection (List) object in the session, the list is not empty yet the result I get is cannot create an iterator... Every example i see says that you should have a bean that holds the collection so the tag uses the property attribute to retrieve the collection but I thought I could just throw a collection object into session and use it with the tag. What am I missing? -Original Message- From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 1:33 PM To: Struts Users Mailing List Subject: RE: Logic Iterate in Struts Deepak, Yesterday I posted a link containing source code on how to use the iterate tag. http://moosejaw.org/java/struts-iterate/ I hope it helps you. Matt -Original Message- From: Yinti, Deepak [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:25 PM To: Struts Users Mailing List Subject: RE: Logic Iterate in Struts I want to iterate thru by bean and retrieve all values in JSP thru this tag Deepak -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:20 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts That's not overly general or anything ** Note the sarcasm ** What do you want to know? -Original Message- From: Yinti, Deepak [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:13 PM To: Struts Users Mailing List Subject: Logic Iterate in Struts Can some body some body tell me about logic iterate tag Thanks Deepak This e-mail may contain confidential or privileged information. If you think you have received this e-mail in error, please advise the sender by reply e-mail and then delete this e-mail immediately. Thank you. Aetna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logic Iterate in Struts
logic:iterate id=details name=txndetails ... /logic:iterate java code was like List list = some_business_layer_call to return a list session.setAttribute(txndetails, list); error is cannot create iterator for collection -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 3:16 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts It all depends on how you use the tag. Show us how you tried to do this and what error was returned. -Tim -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 4:07 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts I am having a problem with this tag as well. My issue it that I set a collection (List) object in the session, the list is not empty yet the result I get is cannot create an iterator... Every example i see says that you should have a bean that holds the collection so the tag uses the property attribute to retrieve the collection but I thought I could just throw a collection object into session and use it with the tag. What am I missing? -Original Message- From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 1:33 PM To: Struts Users Mailing List Subject: RE: Logic Iterate in Struts Deepak, Yesterday I posted a link containing source code on how to use the iterate tag. http://moosejaw.org/java/struts-iterate/ I hope it helps you. Matt -Original Message- From: Yinti, Deepak [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:25 PM To: Struts Users Mailing List Subject: RE: Logic Iterate in Struts I want to iterate thru by bean and retrieve all values in JSP thru this tag Deepak -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:20 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts That's not overly general or anything ** Note the sarcasm ** What do you want to know? -Original Message- From: Yinti, Deepak [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:13 PM To: Struts Users Mailing List Subject: Logic Iterate in Struts Can some body some body tell me about logic iterate tag Thanks Deepak This e-mail may contain confidential or privileged information. If you think you have received this e-mail in error, please advise the sender by reply e-mail and then delete this e-mail immediately. Thank you. Aetna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logic Iterate in Struts
I am looking int the jstl stuff, I honestly just haven't used it yet, sounds like the thing to do its just hard to get managers to agree to let you use new stuff :( -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 4:11 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts have you tried: logic:iterate id=details collection=txndetails ... /logic:iterate ? Better yet.. why not just use JSTL? c:forEach var=details items=${txndetails} ... /c:forEach -Tim -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 4:31 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts logic:iterate id=details name=txndetails ... /logic:iterate java code was like List list = some_business_layer_call to return a list session.setAttribute(txndetails, list); error is cannot create iterator for collection -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 3:16 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts It all depends on how you use the tag. Show us how you tried to do this and what error was returned. -Tim -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 4:07 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts I am having a problem with this tag as well. My issue it that I set a collection (List) object in the session, the list is not empty yet the result I get is cannot create an iterator... Every example i see says that you should have a bean that holds the collection so the tag uses the property attribute to retrieve the collection but I thought I could just throw a collection object into session and use it with the tag. What am I missing? -Original Message- From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 1:33 PM To: Struts Users Mailing List Subject: RE: Logic Iterate in Struts Deepak, Yesterday I posted a link containing source code on how to use the iterate tag. http://moosejaw.org/java/struts-iterate/ I hope it helps you. Matt -Original Message- From: Yinti, Deepak [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:25 PM To: Struts Users Mailing List Subject: RE: Logic Iterate in Struts I want to iterate thru by bean and retrieve all values in JSP thru this tag Deepak -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:20 PM To: 'Struts Users Mailing List' Subject: RE: Logic Iterate in Struts That's not overly general or anything ** Note the sarcasm ** What do you want to know? -Original Message- From: Yinti, Deepak [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 2:13 PM To: Struts Users Mailing List Subject: Logic Iterate in Struts Can some body some body tell me about logic iterate tag Thanks Deepak This e-mail may contain confidential or privileged information. If you think you have received this e-mail in error, please advise the sender by reply e-mail and then delete this e-mail immediately. Thank you. Aetna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ANNOUNCEMENT] Struts 1.1 Release Candidate 2 released
I agree, thanks for making our lives easier. Go have a beer or something! -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 6:45 PM To: [EMAIL PROTECTED] Subject: Re: [ANNOUNCEMENT] Struts 1.1 Release Candidate 2 released Of course: Thanks very much Struts-Dev. for your time/talents and a gift to the community at large. .V Martin Cooper wrote: The Struts team is proud to announce the release of Struts 1.1 Release Candidate 2. This release includes some new functionality, but mostly just fixes for a number of bugs which were reported against earlier versions. The Struts Team believes that this release is ready for prime time, hence its designation as a release candidate. The binary distribution is available at: http://www.apache.org/dist/jakarta/struts/binaries/ and the source distribution is available at: http://www.apache.org/dist/jakarta/struts/source/ In addition, the library distribution, which contains updated binaries without the sample applications, is available at: http://www.apache.org/dist/jakarta/struts/library/ Details of the changes in this release are available in the Release Notes, which can be found here: http://jakarta.apache.org/struts/userGuide/release-notes-1.1-rc2.html Special thanks to Ted Husted for his help in preparing this release. -- Martin Cooper -- Vic Cekvenich, Struts Instructor, 1-800-917-JAVA Advanced a href =baseBeans.comStruts Training/a and project recovery in North East. Open Source a href =baseBeans.comContent Management/a basicPortal sofware Best practicea href =baseBeans.comStruts Support/a v.1.1 helper ScafflodingXPress - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Control Access
Where is this securityfilter project? -Original Message- From: Scott Barr [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 11:15 PM To: Struts Users Mailing List Subject: Re: Control Access Or as Max Cooper says, check out the securityfilter project :D I haven't used it myself, I use container manager authentication and jdbc realms, but the securityfilter project does look pretty cool. Scott Barr www.exergonic.com.au On Thu, 2003-03-20 at 15:59, Joey Ebright wrote: The documentation that comes with Struts and the examples actually show a great example of doing this. Basically there is a tag that you place at the top of each JSP page that checks to see if the user has an object in session (has logged in) and if not, redirects them to the login page. Hope this helps... mahesh kagitha wrote: Can any one please explain the following... I'm developing an application which has login page(JSP) to access the application and I should allow only the successfully logged in users to navigate my application otherwise direct to login page. My question here is... How can I do that.? Thanks in Advance. - Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:select problems
If I do something like this html:select property=value(selectedDistributor) name=distributors html:optionsCollection name=distributors property=dependent label=value(description) property=value(distributorId) / /html:select I get an error that the iterator can't be created, however, this works with the same objects logic:present name=DistributorList logic:iterate id=distlist name=DistributorList property=dependent html:text name=distlist property=value(distributorId) / /logic:iterate /logic:present so it appears that the select tag can't handle property=value(sometext) Can anyone confirm this?
RE: html:select problems
Never mind i was being stupid -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 10:22 AM To: Struts-User (E-mail) Subject: html:select problems If I do something like this html:select property=value(selectedDistributor) name=distributors html:optionsCollection name=distributors property=dependent label=value(description) property=value(distributorId) / /html:select I get an error that the iterator can't be created, however, this works with the same objects logic:present name=DistributorList logic:iterate id=distlist name=DistributorList property=dependent html:text name=distlist property=value(distributorId) / /logic:iterate /logic:present so it appears that the select tag can't handle property=value(sometext) Can anyone confirm this?
Lost in beans
Is it possible or is there a better way to do something like form-beans form-bean name=User type=org.apache.struts.validator.DynaValidatorForm form-property name=fname type=java.lang.String / form-property name=lname type=java.lang.String / form-bean name=Addredd type=org.apache.struts.validator.DynaValidatorForm form-property name=street type=java.lang.String / form-property name=city type=java.lang.String / /form-bean /form-bean form-beans Basically looking for a way to nest beans in the struts config and use them in forms/actions/validation. Thanks
RE: Lost in beans
So if your not using dynaforms are you back to extending actionform? If so are you not using the validator framework either? -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:19 PM To: Struts Users Mailing List Subject: Re: Lost in beans This is exactly the same as to what I am trying to do...no luck so far. I reverted back to using no DynaForms. --- Mike Ash [EMAIL PROTECTED] wrote: Is it possible or is there a better way to do something like form-beans form-bean name=User type=org.apache.struts.validator.DynaValidatorForm form-property name=fname type=java.lang.String / form-property name=lname type=java.lang.String / form-bean name=Addredd type=org.apache.struts.validator.DynaValidatorForm form-property name=street type=java.lang.String / form-property name=city type=java.lang.String / /form-bean /form-bean form-beans Basically looking for a way to nest beans in the struts config and use them in forms/actions/validation. Thanks __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Lost in beans
Guess its time to look at contributing...geez more coding outside of work...wife is going to love it -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:31 PM To: Struts Users Mailing List Subject: RE: Lost in beans Yes, I am back to extending ActionForm and ValidatorForm. I hope that nested DynaForms will be supported in the near future. --- Pani, Gourav [EMAIL PROTECTED] wrote: You can extend the ValidatorForm and use the validator framework. -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:25 PM To: 'Struts Users Mailing List' Subject: RE: Lost in beans So if your not using dynaforms are you back to extending actionform? If so are you not using the validator framework either? -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:19 PM To: Struts Users Mailing List Subject: Re: Lost in beans This is exactly the same as to what I am trying to do...no luck so far. I reverted back to using no DynaForms. --- Mike Ash [EMAIL PROTECTED] wrote: Is it possible or is there a better way to do something like form-beans form-bean name=User type=org.apache.struts.validator.DynaValidatorForm form-property name=fname type=java.lang.String / form-property name=lname type=java.lang.String / form-bean name=Addredd type=org.apache.struts.validator.DynaValidatorForm form-property name=street type=java.lang.String / form-property name=city type=java.lang.String / /form-bean /form-bean form-beans Basically looking for a way to nest beans in the struts config and use them in forms/actions/validation. Thanks __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Lost in beans
True, not sure what I was thinking about that except that you can't nest the dynaValidatorForm beans in the struts-config either , which is what I really prefer. -Original Message- From: Pani, Gourav [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:29 PM To: 'Struts Users Mailing List' Subject: RE: Lost in beans You can extend the ValidatorForm and use the validator framework. -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:25 PM To: 'Struts Users Mailing List' Subject: RE: Lost in beans So if your not using dynaforms are you back to extending actionform? If so are you not using the validator framework either? -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:19 PM To: Struts Users Mailing List Subject: Re: Lost in beans This is exactly the same as to what I am trying to do...no luck so far. I reverted back to using no DynaForms. --- Mike Ash [EMAIL PROTECTED] wrote: Is it possible or is there a better way to do something like form-beans form-bean name=User type=org.apache.struts.validator.DynaValidatorForm form-property name=fname type=java.lang.String / form-property name=lname type=java.lang.String / form-bean name=Addredd type=org.apache.struts.validator.DynaValidatorForm form-property name=street type=java.lang.String / form-property name=city type=java.lang.String / /form-bean /form-bean form-beans Basically looking for a way to nest beans in the struts config and use them in forms/actions/validation. Thanks __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Lost in beans
Now its getting interesting, I was starting to look at a converter solution as well but didn't get anywhere, got some concrete example I could admire? -Original Message- From: Matthew Meyer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:29 PM To: Struts Users Mailing List Subject: Re: Lost in beans I was actually looking for an easy way to do just this (nest Dynas) for 4 hours today.. The easiest hack(at least in my mind a hack) is to write a beanutils Converter to convert from a string to DynaActionFrom. Then when DynaActionFormClass.newInstance() sets the inital property values have your converter registered, and make sure the inital property in the XML for you nested DynaForm it set to the DynaForm you want to use. Then just implement the converter to do public Object convert(Class type, Object value){ return DynaActionFormClass.getDynaActionFormClass((String)value).newInstance(); } I have not tested this yet as I would like a better way but I would call it a decent 'HACK'. Matt, On Wed, 5 Feb 2003 15:32:03 -0600 Mike Ash [EMAIL PROTECTED] wrote: Guess its time to look at contributing...geez more coding outside of work...wife is going to love it -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:31 PM To: Struts Users Mailing List Subject: RE: Lost in beans Yes, I am back to extending ActionForm and ValidatorForm. I hope that nested DynaForms will be supported in the near future. --- Pani, Gourav [EMAIL PROTECTED] wrote: You can extend the ValidatorForm and use the validator framework. -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:25 PM To: 'Struts Users Mailing List' Subject: RE: Lost in beans So if your not using dynaforms are you back to extending actionform? If so are you not using the validator framework either? -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:19 PM To: Struts Users Mailing List Subject: Re: Lost in beans This is exactly the same as to what I am trying to do...no luck so far. I reverted back to using no DynaForms. --- Mike Ash [EMAIL PROTECTED] wrote: Is it possible or is there a better way to do something like form-beans form-bean name=User type=org.apache.struts.validator.DynaValidatorForm form-property name=fname type=java.lang.String / form-property name=lname type=java.lang.String / form-bean name=Addredd type=org.apache.struts.validator.DynaValidatorForm form-property name=street type=java.lang.String / form-property name=city type=java.lang.String / /form-bean /form-bean form-beans Basically looking for a way to nest beans in the struts config and use them in forms/actions/validation. Thanks __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Lost in beans
Thanks, at least your home, I'm still here ;(, I am going to try and implement this, I'll let you know what happens. -Original Message- From: Matthew Meyer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 5:16 PM To: Struts Users Mailing List Subject: Re: Lost in beans I was thinking about this more on my way home from work.. :) As far as doing it as a hack I would simply implement and register the converter as anonymous class. form-bean name=NestedTestForm type=org.apache.struts.action.DynaActionForm form-property name=value type=java.lang.String / /form-bean form-bean name=TestForm type=org.apache.struts.action.DynaActionForm form-property name=nested type=org.apache.struts.action.DynaActionForm initial=NestedTestForm/ /form-bean Then in your initServlet()... import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils.Converter; ConvertUtils.register(new Converter(){ public Object convert(Class type, Object value){ return DynaActionFormClass.getDynaActionFormClass((String)value).newInstance(); } }, DynaActionForm.Class); Then when the app initialized DynaActionFormClass.newInstance() is called for a TestForm it looks for a converter for the class DynaActionForm to set the initial value an passes it the name NestedTestForm. Like I said before though didn't have time to test this today you might run into other problems, and it would be much better if there was a permanent solution.. Matt, - Original Message - From: Mike Ash [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 4:36 PM Subject: RE: Lost in beans Now its getting interesting, I was starting to look at a converter solution as well but didn't get anywhere, got some concrete example I could admire? -Original Message- From: Matthew Meyer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:29 PM To: Struts Users Mailing List Subject: Re: Lost in beans I was actually looking for an easy way to do just this (nest Dynas) for 4 hours today.. The easiest hack(at least in my mind a hack) is to write a beanutils Converter to convert from a string to DynaActionFrom. Then when DynaActionFormClass.newInstance() sets the inital property values have your converter registered, and make sure the inital property in the XML for you nested DynaForm it set to the DynaForm you want to use. Then just implement the converter to do public Object convert(Class type, Object value){ return DynaActionFormClass.getDynaActionFormClass((String)value).newInstance(); } I have not tested this yet as I would like a better way but I would call it a decent 'HACK'. Matt, On Wed, 5 Feb 2003 15:32:03 -0600 Mike Ash [EMAIL PROTECTED] wrote: Guess its time to look at contributing...geez more coding outside of work...wife is going to love it -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:31 PM To: Struts Users Mailing List Subject: RE: Lost in beans Yes, I am back to extending ActionForm and ValidatorForm. I hope that nested DynaForms will be supported in the near future. --- Pani, Gourav [EMAIL PROTECTED] wrote: You can extend the ValidatorForm and use the validator framework. -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:25 PM To: 'Struts Users Mailing List' Subject: RE: Lost in beans So if your not using dynaforms are you back to extending actionform? If so are you not using the validator framework either? -Original Message- From: J Beginner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:19 PM To: Struts Users Mailing List Subject: Re: Lost in beans This is exactly the same as to what I am trying to do...no luck so far. I reverted back to using no DynaForms. --- Mike Ash [EMAIL PROTECTED] wrote: Is it possible or is there a better way to do something like form-beans form-bean name=User type=org.apache.struts.validator.DynaValidatorForm form-property name=fname type=java.lang.String / form-property name=lname type=java.lang.String / form-bean name=Addredd type=org.apache.struts.validator.DynaValidatorForm form-property name=street type=java.lang.String / form-property name=city type=java.lang.String / /form-bean /form-bean form-beans Basically looking for a way to nest beans in the struts config and use them in forms/actions/validation. Thanks __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
RE: multi row / multi col input forms
Thanks! I finally see the light. -Original Message- From: James Turner [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 5:44 PM To: 'Struts Users Mailing List' Subject: RE: multi row / multi col input forms Here's one way to do it: Let's say you want to be able to record the grades of some students across a number of classes. First define a Bean called StudentGrades: Package example; public StudentGrades { private String name, biology, chemistry, physics, english, math; public String getName () { return this.name; } public String getBiology () { return this.biology; } public String getChemisty () { return this.chemistry; } public String getPhysics () { return this.physics; } public String getEnglish () { return this.english; } public String getMath () { return this.math; } public void setName (String name) { this.name = name; } public void setBiology (String grade) { this.biology = grade; } public void setChemisty (String grade) { this.chemistry = grade; } public void setPhysics (String grade) { this.physics = grade; } public void setEnglish (String grade) { this.english = grade; } public void setMath (String grade) { this.math = grade; } } In your struts-config.xml, define: form-bean name=studentGradeForm type=org.apache.struts.validator.DynaValidatorForm form-property name=grades type=example.StudentGrades[] size=50 /form-bean Then, presuming that your Action populates the StudentGrades array with the student names, in your JSP, you'd say: html:form action=/some/action TABLETRTDName/TDTDBiology/TDTDChemistry/TDTDPhysics/T DTDEnglish/TDTDMath/TD/TR logic:iterate id=student name=studentGradeForm property=grades type=example.StudentGrades logic:notEmpty name=student property=name TRTDbean:write name=student property=name indexed=true//TD TDhtml:text name=student property=biology indexed=true//TD TDhtml:text name=student property=chimstry indexed=true//TD TDhtml:text name=student property=physics indexed=true//TD TDhtml:text name=student property=english indexed=true//TD TDhtml:text name=student property=math indexed=true//TD/TR /logic:notEmpty /logic:iterate /TABLE -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 5:04 PM To: 'Struts Users Mailing List' Subject: RE: multi row / multi col input forms I understand what he is saying about setter methods perhaps I am not explaining the problem correctly The exact example is I am trying to display a listing of a dynamic number of projects with hours assigned to them by day for a given week, the user can then update any of those fields to make changes, some of those fields may be blank which means the browser will not send them to the server which puts the rows / cols out of balance. I am using the logic iterate tag to build a row which looks like someText someMoreText inputBox1 inputBox2 inputBox3 inputBox4 So for two rows I get someText someMoreText inputBox1 inputBox2 inputBox3 inputBox4 someText someMoreText inputBox1 inputBox2 inputBox3 inputBox4 This means that from a vertical perspective the boxes have the same name ( is there a better way to do the names?) If a inputBox doesn't contain anything I can't tell which one it really was except which column it didn't come from. Clear as mud? -Original Message- From: Khalid K. [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 3:51 PM To: Struts Users Mailing List Subject: Re: multi row / multi col input forms please read the post below from Craig(he answered a similar question..see question/answer below) On Thu, 2 Jan 2003, Toni Charlot wrote: Date: Thu, 2 Jan 2003 10:10:32 -0500 From: Toni Charlot [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED], [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: REPOST: Forcing the ActionForm to populate a field before the other I would like to have a setter method called before another. What's the best way to do that in the ActionForm There are no guarantees on the order that the setters are called. This is for two reasons: * There is no rule in the HTTP or HTML specs defining the order in which the request parameters are sent, so it's totally up to the client. And they really do operate differently. * There is no rule in the servlet spec saying that the input order has to be preserved, so it's totally up to the container to decide how to implement this. And they really do operate differently. More fundamentally, though, the only reason that the setter order would matter is if there are side effects (setting one property affects the semantics of setting a different one). Designing your form beans in this way is a very poor architectural decision -- the whole point of a form bean is to simply represent the input values that the user actually entered
multi row / multi col input forms
Is there a way to get the inputs from an html form that has something like: col1col2col3 row x x x row x x x row x x x where x may or may not be entered and the input boxes are named like col1, col2, col3. So if a user enter a number in row2, col1 and row3, col1 how to tell that it was row 2 and 3 that where entered because hen inputs are named the same the parameters come back to the server as an array but there is no guarantee which order they were in especially if the first one was blank as in this case. The array looks like I had two entries in col1 but the numbers are in position 0, and 1. which they should be in position 1 and 2. Any thoughts.
RE: multi row / multi col input forms
I understand what he is saying about setter methods perhaps I am not explaining the problem correctly The exact example is I am trying to display a listing of a dynamic number of projects with hours assigned to them by day for a given week, the user can then update any of those fields to make changes, some of those fields may be blank which means the browser will not send them to the server which puts the rows / cols out of balance. I am using the logic iterate tag to build a row which looks like someText someMoreText inputBox1 inputBox2 inputBox3 inputBox4 So for two rows I get someText someMoreText inputBox1 inputBox2 inputBox3 inputBox4 someText someMoreText inputBox1 inputBox2 inputBox3 inputBox4 This means that from a vertical perspective the boxes have the same name ( is there a better way to do the names?) If a inputBox doesn't contain anything I can't tell which one it really was except which column it didn't come from. Clear as mud? -Original Message- From: Khalid K. [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 3:51 PM To: Struts Users Mailing List Subject: Re: multi row / multi col input forms please read the post below from Craig(he answered a similar question..see question/answer below) On Thu, 2 Jan 2003, Toni Charlot wrote: Date: Thu, 2 Jan 2003 10:10:32 -0500 From: Toni Charlot [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED], [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: REPOST: Forcing the ActionForm to populate a field before the other I would like to have a setter method called before another. What's the best way to do that in the ActionForm There are no guarantees on the order that the setters are called. This is for two reasons: * There is no rule in the HTTP or HTML specs defining the order in which the request parameters are sent, so it's totally up to the client. And they really do operate differently. * There is no rule in the servlet spec saying that the input order has to be preserved, so it's totally up to the container to decide how to implement this. And they really do operate differently. More fundamentally, though, the only reason that the setter order would matter is if there are side effects (setting one property affects the semantics of setting a different one). Designing your form beans in this way is a very poor architectural decision -- the whole point of a form bean is to simply represent the input values that the user actually entered on the form. Any functionality that tries to assign meaning to these inputs should be done in business logic (which can pull data out of the form bean in any order that you need), not in the form bean itself. Thank you. Craig McClanahan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] - Original Message - From: Mike Ash [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 02, 2003 1:46 PM Subject: multi row / multi col input forms Is there a way to get the inputs from an html form that has something like: col1 col2 col3 row x x x row x x x row x x x where x may or may not be entered and the input boxes are named like col1, col2, col3. So if a user enter a number in row2, col1 and row3, col1 how to tell that it was row 2 and 3 that where entered because hen inputs are named the same the parameters come back to the server as an array but there is no guarantee which order they were in especially if the first one was blank as in this case. The array looks like I had two entries in col1 but the numbers are in position 0, and 1. which they should be in position 1 and 2. Any thoughts. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: multi row / multi col input forms
OOPs! If I were to RTFM I would have found it, the tags have the indexed attribute. Thanks! -Original Message- From: Khalid K. [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 3:51 PM To: Struts Users Mailing List Subject: Re: multi row / multi col input forms please read the post below from Craig(he answered a similar question..see question/answer below) On Thu, 2 Jan 2003, Toni Charlot wrote: Date: Thu, 2 Jan 2003 10:10:32 -0500 From: Toni Charlot [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED], [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: REPOST: Forcing the ActionForm to populate a field before the other I would like to have a setter method called before another. What's the best way to do that in the ActionForm There are no guarantees on the order that the setters are called. This is for two reasons: * There is no rule in the HTTP or HTML specs defining the order in which the request parameters are sent, so it's totally up to the client. And they really do operate differently. * There is no rule in the servlet spec saying that the input order has to be preserved, so it's totally up to the container to decide how to implement this. And they really do operate differently. More fundamentally, though, the only reason that the setter order would matter is if there are side effects (setting one property affects the semantics of setting a different one). Designing your form beans in this way is a very poor architectural decision -- the whole point of a form bean is to simply represent the input values that the user actually entered on the form. Any functionality that tries to assign meaning to these inputs should be done in business logic (which can pull data out of the form bean in any order that you need), not in the form bean itself. Thank you. Craig McClanahan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] - Original Message - From: Mike Ash [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 02, 2003 1:46 PM Subject: multi row / multi col input forms Is there a way to get the inputs from an html form that has something like: col1 col2 col3 row x x x row x x x row x x x where x may or may not be entered and the input boxes are named like col1, col2, col3. So if a user enter a number in row2, col1 and row3, col1 how to tell that it was row 2 and 3 that where entered because hen inputs are named the same the parameters come back to the server as an array but there is no guarantee which order they were in especially if the first one was blank as in this case. The array looks like I had two entries in col1 but the numbers are in position 0, and 1. which they should be in position 1 and 2. Any thoughts. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]