RE: nested:iterate in an included page
I did not have any nested tags in the top page so I added one and now my code looks like this: (Your example referenced nested:property and I assume you meant nested:nest) That'd be the one... :) I am still getting the null reference on the first nested tag in the included jsp. I am using Struts 1.1B2. 1.1 is what we need. I must admit to not totally understanding your explanation of what property to reference in the nested parent tag Doesn't really matter, but a parent nested tag (root, iterate, nest etc) put the reference to the root bean and the current nested property into the request object. This is so included pages can get a reference to the root bean the the correct nested property by fetching it back out of the request object. -- I am referencing my form object (which is, in fact, the parent I want). I am also still a bit confused on whether I need a nested root tag or not. This is where I have to apologise. You'll need an empty (no properties are set at all) nested:root tag in the included page, this will then look to the request object for the bean/property reference. Sorry about the hassle. If you have any trouble, rather than wait for replies from the list to run over the start of the tutorial I wrote about nesting through includes to make a tree structure... http://www.keyboardmonkey.com/pilotlight ...and click on the first link in the JSP Reursion TREES tutorial. Arron. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: nested:iterate in an included page
hey arron and chris, Good stuff on this nested tag issue. When you say you need struts 1.1 instead of 1.1 b2, are you referring to just grabbing one of the nightly builds or something else. Hook me up brother!!! dz -Original Message- From: Arron Bates [mailto:struts-user;keyboardmonkey.com] Sent: Friday, November 15, 2002 7:28 AM To: Struts Users Mailing List Subject: RE: nested:iterate in an included page I did not have any nested tags in the top page so I added one and now my code looks like this: (Your example referenced nested:property and I assume you meant nested:nest) That'd be the one... :) I am still getting the null reference on the first nested tag in the included jsp. I am using Struts 1.1B2. 1.1 is what we need. I must admit to not totally understanding your explanation of what property to reference in the nested parent tag Doesn't really matter, but a parent nested tag (root, iterate, nest etc) put the reference to the root bean and the current nested property into the request object. This is so included pages can get a reference to the root bean the the correct nested property by fetching it back out of the request object. -- I am referencing my form object (which is, in fact, the parent I want). I am also still a bit confused on whether I need a nested root tag or not. This is where I have to apologise. You'll need an empty (no properties are set at all) nested:root tag in the included page, this will then look to the request object for the bean/property reference. Sorry about the hassle. If you have any trouble, rather than wait for replies from the list to run over the start of the tutorial I wrote about nesting through includes to make a tree structure... http://www.keyboardmonkey.com/pilotlight ...and click on the first link in the JSP Reursion TREES tutorial. Arron. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: nested:iterate in an included page
just ran into this yesterday. From what i can tell, the nested tags NEED the html:form tags on that very page, or else it cant seem to resolve the form object. If anyone knows a way around this, i'd like to hear it as this seems to defeat the purpose of templating... try putting the form tags just on that included page and see if you get the errors. dz -Original Message- From: Chris Sargent [mailto:csargent;aerisinc.com] Sent: Thursday, November 14, 2002 4:07 PM To: Struts Mail List Subject: nested:iterate in an included page I am having trouble using the nested:iterate tag in a page that I am including using jsp:include. I am probably doing something silly, but could someone provide some help? My main page looks like this: ... html:form action=/Time/SaveTimesheet styleId=GridForm ... jsp:include page=TimesheetGrid1View.jsp / ... And the included page looks like this: nested:root name=timesheetForm / nested:iterate indexId=index id=entry property=timesheet.line[0].entry type=TimesheetLineEntry I get a null ref error on the nested:iterate tag in the included page. Any help is much appreciated! Chris -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: nested:iterate in an included page
Thanks Drew... thanks for your response. I know the code will work if the form tag is on the same page -- I have code like that in other places. The reason for the inlcude is to reuse pieces of the page and putting the form in the included file would defeat that purpose in this case. Chris -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 1:12 PM To: 'Struts Users Mailing List' Subject: RE: nested:iterate in an included page just ran into this yesterday. From what i can tell, the nested tags NEED the html:form tags on that very page, or else it cant seem to resolve the form object. If anyone knows a way around this, i'd like to hear it as this seems to defeat the purpose of templating... try putting the form tags just on that included page and see if you get the errors. dz -Original Message- From: Chris Sargent [mailto:csargent;aerisinc.com] Sent: Thursday, November 14, 2002 4:07 PM To: Struts Mail List Subject: nested:iterate in an included page I am having trouble using the nested:iterate tag in a page that I am including using jsp:include. I am probably doing something silly, but could someone provide some help? My main page looks like this: ... html:form action=/Time/SaveTimesheet styleId=GridForm ... jsp:include page=TimesheetGrid1View.jsp / ... And the included page looks like this: nested:root name=timesheetForm / nested:iterate indexId=index id=entry property=timesheet.line[0].entry type=TimesheetLineEntry I get a null ref error on the nested:iterate tag in the included page. Any help is much appreciated! Chris -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: nested:iterate in an included page
You need at least one nested parent tag on the top page with the html:form tag. This will allow the nested tags to put their parent reference into the request object, from which the nested tags in the included page can pick it up. eg: html:form action=/Time/SaveTimesheet styleId=GridForm nested:property property=someProperty jsp:include page=TimesheetGrid1View.jsp / /nested:property /html:form ...and no, you can't use ./ or this/, but can be a fake property (a named property which just returns a reference to the same bean). If there's already a nested level like this, then it's a case of versioning. What version of Struts are you using?... Arron. Thanks Drew... thanks for your response. I know the code will work if the form tag is on the same page -- I have code like that in other places. The reason for the inlcude is to reuse pieces of the page and putting the form in the included file would defeat that purpose in this case. Chris -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 1:12 PM To: 'Struts Users Mailing List' Subject: RE: nested:iterate in an included page just ran into this yesterday. From what i can tell, the nested tags NEED the html:form tags on that very page, or else it cant seem to resolve the form object. If anyone knows a way around this, i'd like to hear it as this seems to defeat the purpose of templating... try putting the form tags just on that included page and see if you get the errors. dz -Original Message- From: Chris Sargent [mailto:csargent;aerisinc.com] Sent: Thursday, November 14, 2002 4:07 PM To: Struts Mail List Subject: nested:iterate in an included page I am having trouble using the nested:iterate tag in a page that I am including using jsp:include. I am probably doing something silly, but could someone provide some help? My main page looks like this: ... html:form action=/Time/SaveTimesheet styleId=GridForm ... jsp:include page=TimesheetGrid1View.jsp / ... And the included page looks like this: nested:root name=timesheetForm / nested:iterate indexId=index id=entry property=timesheet.line[0].entry type=TimesheetLineEntry I get a null ref error on the nested:iterate tag in the included page. Any help is much appreciated! Chris -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: nested:iterate in an included page
Thanks for the reply Aaron. I did not have any nested tags in the top page so I added one and now my code looks like this: (Your example referenced nested:property and I assume you meant nested:nest) html:form action=/Time/SaveTimesheet styleId=GridForm nested:nest property=timesheetForm jsp:include page=TimesheetGrid1View.jsp / /nested:nest /html:form I am still getting the null reference on the first nested tag in the included jsp. I am using Struts 1.1B2. I must admit to not totally understanding your explanation of what property to reference in the nested parent tag -- I am referencing my form object (which is, in fact, the parent I want). I am also still a bit confused on whether I need a nested root tag or not. Thanks very much for the help. Chris -Original Message- From: Arron Bates [mailto:struts-user;keyboardmonkey.com] Sent: Thursday, November 14, 2002 2:21 PM To: Struts Users Mailing List Subject: RE: nested:iterate in an included page You need at least one nested parent tag on the top page with the html:form tag. This will allow the nested tags to put their parent reference into the request object, from which the nested tags in the included page can pick it up. eg: html:form action=/Time/SaveTimesheet styleId=GridForm nested:property property=someProperty jsp:include page=TimesheetGrid1View.jsp / /nested:property /html:form ...and no, you can't use ./ or this/, but can be a fake property (a named property which just returns a reference to the same bean). If there's already a nested level like this, then it's a case of versioning. What version of Struts are you using?... Arron. Thanks Drew... thanks for your response. I know the code will work if the form tag is on the same page -- I have code like that in other places. The reason for the inlcude is to reuse pieces of the page and putting the form in the included file would defeat that purpose in this case. Chris -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 1:12 PM To: 'Struts Users Mailing List' Subject: RE: nested:iterate in an included page just ran into this yesterday. From what i can tell, the nested tags NEED the html:form tags on that very page, or else it cant seem to resolve the form object. If anyone knows a way around this, i'd like to hear it as this seems to defeat the purpose of templating... try putting the form tags just on that included page and see if you get the errors. dz -Original Message- From: Chris Sargent [mailto:csargent;aerisinc.com] Sent: Thursday, November 14, 2002 4:07 PM To: Struts Mail List Subject: nested:iterate in an included page I am having trouble using the nested:iterate tag in a page that I am including using jsp:include. I am probably doing something silly, but could someone provide some help? My main page looks like this: ... html:form action=/Time/SaveTimesheet styleId=GridForm ... jsp:include page=TimesheetGrid1View.jsp / ... And the included page looks like this: nested:root name=timesheetForm / nested:iterate indexId=index id=entry property=timesheet.line[0].entry type=TimesheetLineEntry I get a null ref error on the nested:iterate tag in the included page. Any help is much appreciated! Chris -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org