RE: Understanding the Iterate Tag
Have you looked at the userguide? Did you open the struts-example? I did not test this in a jsp, so you may need to verify % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); % logic:iterate id=c name=results scope=session bean:write name=c property=title/ bean:write name=c property=description/ /logic:iterate -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: Brian Hart [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:37 PM To: [EMAIL PROTECTED] Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Understanding the Iterate Tag
Hi here is the *translation* : logic:iterate id=SearchResultBean name=results bean:write name=results property=title/ bean:write name=results property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian - 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: Understanding the Iterate Tag
I think you may gotten the id and name reversed.. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:46 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag Hi here is the *translation* : logic:iterate id=SearchResultBean name=results bean:write name=results property=title/ bean:write name=results property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian -- -- - 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: Understanding the Iterate Tag
On Friday, Feb 21, 2003, at 14:46 US/Eastern, alexj wrote: Hi here is the *translation* : logic:iterate id=SearchResultBean name=results bean:write name=results property=title/ bean:write name=results property=description/ /logic:iterate No Alex, the SearchResultBean id should be in the name= part not the name of the results collection. Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian --- - - 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: Understanding the Iterate Tag
logic:iterate id=SearchResultBean name=results bean:write name=SearchResultBean property=title/ bean:write name=SearchResultBean property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian -- -- - 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: Understanding the Iterate Tag
yep I think to :) - Original Message - From: James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:47 PM Subject: RE: Understanding the Iterate Tag I think you may gotten the id and name reversed.. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:46 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag Hi here is the *translation* : logic:iterate id=SearchResultBean name=results bean:write name=results property=title/ bean:write name=results property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian -- -- - 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: Understanding the Iterate Tag
LOL.ignore my correction then. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:48 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag logic:iterate id=SearchResultBean name=results bean:write name=SearchResultBean property=title/ bean:write name=SearchResultBean property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian -- -- - 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: Understanding the Iterate Tag
I ve better to didn't post when I drink my beers ;) - Original Message - From: alexj [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:49 PM Subject: Re: Understanding the Iterate Tag yep I think to :) - Original Message - From: James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:47 PM Subject: RE: Understanding the Iterate Tag I think you may gotten the id and name reversed.. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:46 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag Hi here is the *translation* : logic:iterate id=SearchResultBean name=results bean:write name=results property=title/ bean:write name=results property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian -- -- - 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: Understanding the Iterate Tag
What? Why aren't you sharing ;) -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:52 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag I ve better to didn't post when I drink my beers ;) - Original Message - From: alexj [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:49 PM Subject: Re: Understanding the Iterate Tag yep I think to :) - Original Message - From: James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:47 PM Subject: RE: Understanding the Iterate Tag I think you may gotten the id and name reversed.. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:46 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag Hi here is the *translation* : logic:iterate id=SearchResultBean name=results bean:write name=results property=title/ bean:write name=results property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian -- -- - 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: Understanding the Iterate Tag
:p - Original Message - From: James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:54 PM Subject: RE: Understanding the Iterate Tag What? Why aren't you sharing ;) -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:52 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag I ve better to didn't post when I drink my beers ;) - Original Message - From: alexj [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:49 PM Subject: Re: Understanding the Iterate Tag yep I think to :) - Original Message - From: James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:47 PM Subject: RE: Understanding the Iterate Tag I think you may gotten the id and name reversed.. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: alexj [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 2:46 PM To: Struts Users Mailing List Subject: Re: Understanding the Iterate Tag Hi here is the *translation* : logic:iterate id=SearchResultBean name=results bean:write name=results property=title/ bean:write name=results property=description/ /logic:iterate Alexandre Jaquet - Original Message - From: Brian Hart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 21, 2003 8:36 PM Subject: Understanding the Iterate Tag I have a JavaBean Array in the session scope which I can loop through in a scriptlet to output properties of each member of the array. Example: % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getTitle()); out.println(c[x].getDescription()); } % What is the equivalent syntax for the above using the struts logic:iterate tag? Thank You, Brian -- -- - 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: Understanding the Iterate Tag
Your Example still Failed. I received a no 'getter' method found for property Description. As suggested I found the user guide and the logic below seems to be the proper equilvalent syntax of the scriptlet loop sample. Does anyone else have further insight on the appropriate way to return a set of JavaBeans? I am using JavaBeans to represent the Model and often want to return an array of them. I don't use the ActionForm beans for this purpose as best practices indicate that you should not use the actionform as your model which makes perfect sense. I was just confused as to the most efficient mechanism for passing the model back to the JSP page to render. Currently most of my business logic is design to bringback Javabean[] arrays when sets of data (not SQL Data, but various search engine results being consolidated into one searchResultBean) are involved % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getDescription()); } % logic:iterate collection=results id=result bean:write name=result property=description/ /logic:iterate !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META content=text/html; charset=iso-8859-1 http-equiv=Content-Type META content=MSHTML 5.00.3510.1100 name=GENERATOR/HEAD BODY style=FONT: 10pt Tahoma; MARGIN-LEFT: 2px; MARGIN-TOP: 2px DIVYour Example still Failed.nbsp; I received a no 'getter' method found for property Description.nbsp; As suggested I found the user guide and the logic below seems to be the proper equilvalent syntax of the scriptlet loop sample.nbsp; Does anyone else have further insight on the appropriate way to return a set of JavaBeans?nbsp; I am using JavaBeans to represent the Model and often want to return an array of them.nbsp; I don't use the ActionForm beans for this purpose as best practices indicate that you should not use the actionform as your model which makes perfect sense.nbsp; I was just confused as to the most efficient mechanism for passing the model back to the JSP page to render.nbsp; Currently most of my business logic is design to bringback Javabean[] arrays when sets of data (not SQL Data, but various search engine results being consolidated into one searchResultBean)nbsp; are involved/DIV DIVnbsp;/DIV DIVlt;%BRSearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results);/DIV DIVnbsp;/DIV DIVfor (int x = 0; x lt; c.length; x++){BRnbsp; out.println(c[x].getDescription());BRnbsp; BR}BR%gt;/DIV DIVnbsp;/DIV DIVlt;logic:iterate collection=results id=resultgt;BRnbsp;nbsp; lt;bean:write name=result property=description/gt;BRlt;/logic:iterategt;BR/DIV/BODY/HTML - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Understanding the Iterate Tag
is the error saying Description or description? it might be a typo from you but remember that java is case sensitive and that looking up bean properties should have them starting with a lower case. therefore, bean:write name=result property=description/ may work but bean:write name=result property=Description/ will not. -Tim -Original Message- From: Brian Hart [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 3:31 PM To: [EMAIL PROTECTED] Subject: Re: Understanding the Iterate Tag Your Example still Failed. I received a no 'getter' method found for property Description. As suggested I found the user guide and the logic below seems to be the proper equilvalent syntax of the scriptlet loop sample. Does anyone else have further insight on the appropriate way to return a set of JavaBeans? I am using JavaBeans to represent the Model and often want to return an array of them. I don't use the ActionForm beans for this purpose as best practices indicate that you should not use the actionform as your model which makes perfect sense. I was just confused as to the most efficient mechanism for passing the model back to the JSP page to render. Currently most of my business logic is design to bringback Javabean[] arrays when sets of data (not SQL Data, but various search engine results being consolidated into one searchResultBean) are involved % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getDescription()); } % logic:iterate collection=results id=result bean:write name=result property=description/ /logic:iterate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Understanding the Iterate Tag
Specify the 'type' attribute for the logic:iterate. The value should be the fully qualified class name of each 'result' object. Sri -Original Message- From: Brian Hart [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 3:31 PM To: [EMAIL PROTECTED] Subject: Re: Understanding the Iterate Tag Your Example still Failed. I received a no 'getter' method found for property Description. As suggested I found the user guide and the logic below seems to be the proper equilvalent syntax of the scriptlet loop sample. Does anyone else have further insight on the appropriate way to return a set of JavaBeans? I am using JavaBeans to represent the Model and often want to return an array of them. I don't use the ActionForm beans for this purpose as best practices indicate that you should not use the actionform as your model which makes perfect sense. I was just confused as to the most efficient mechanism for passing the model back to the JSP page to render. Currently most of my business logic is design to bringback Javabean[] arrays when sets of data (not SQL Data, but various search engine results being consolidated into one searchResultBean) are involved % SearchResultBean[] c = (SearchResultBean[]) session.getAttribute(results); for (int x = 0; x c.length; x++){ out.println(c[x].getDescription()); } % logic:iterate collection=results id=result bean:write name=result property=description/ /logic:iterate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]