Re: logic:iterate tag fails on large dataset, succeeds onsmall one?
If both JSTL and Struts are failing, it's probably your code that's broken. David Often a reasonable assumption, in the circumstances, but it turns out not so. I got my page to work with a straight Servlet full of out.println() statements. Then I got it working using one Servlet filling my bean and putting it in session context and then forwarding to the other, in case that was the problem. And then I put in c:out tags to replace my bean:write tags, which I perhaps should have done in the first place. I guess I assumed they'd be as interchangeable as c:forEach and bean:iterate. But c:out works. Which leads me to conclude that the problem might be in bean:write. Am I correct in thinking that future versions of Struts may end up using JSTL anyway? If so, then I guess I'll keep to this approach. Someone else can debug bean:write if they want to. Aaron V. Humphrey Kakari Systems Ltd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate tag fails on large dataset, succeeds on small one?
--- Aaron Humphrey [EMAIL PROTECTED] wrote: If both JSTL and Struts are failing, it's probably your code that's broken. David Often a reasonable assumption, in the circumstances, but it turns out not so. I got my page to work with a straight Servlet full of out.println() statements. Then I got it working using one Servlet filling my bean and putting it in session context and then forwarding to the other, in case that was the problem. And then I put in c:out tags to replace my bean:write tags, which I perhaps should have done in the first place. I guess I assumed they'd be as interchangeable as c:forEach and bean:iterate. But c:out works. Which leads me to conclude that the problem might be in bean:write. Am I correct in thinking that future versions of Struts may end up using JSTL anyway? The Struts tags are largely in maintainence mode at this point because the emphasis is on using standardized technologies like the JSTL. There's been no decision regarding the future of the Struts tags but I haven't seen many committers interested in adding new ones or upgrading existing tags. There doesn't seem to be much point in maintaining proprietary tags when the standard versions are easier to use and more powerful. I'm glad you got it working! David If so, then I guess I'll keep to this approach. Someone else can debug bean:write if they want to. Aaron V. Humphrey Kakari Systems Ltd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate tag fails on large dataset, succeeds on small one?
Hi, I am using struts validator in the logon.jsp of my application. If I don't enter the username click on submit the message displayed is null is required. Instead it should be Username is required. The part of the code in the validator-rules.xml is correct. I have given msg=errors.required Also I have given errors.required={0} is required. prompt.username=Username in the ApplicationResources.properties file. Still it is giving the same alert as null is required instead of Username is required. The corresponding part in the validation.xml is field property=username depends=required, minlength,maxlength arg0 key=prompt.username/ arg1 key=${var:minlength} name=minlength resource=false/ arg2 key=${var:maxlength} name=maxlength resource=false/ var var-namemaxlength/var-name var-value16/var-value /var var var-nameminlength/var-name var-value3/var-value /var /field Has anybody experienced this problem earlier ? prashant. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate tag fails on large dataset, succeeds on smallone?
hi, this happens only when struts is unable to load the resources from the bundle. make sure u have everything in place and restart web application or server. also u may want to try getting that prompt.username from the bundle using bean:messagekey="prompt.username"/ in ur jsp to actually check if struts or validator is the culprit. -- nagi ---Original Message--- From: Struts Users Mailing List Date: Tuesday, July 22, 2003 03:15:09 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag fails on large dataset, succeeds on smallone? Hi,I am using struts validator in the logon.jsp of my application. If I don'tenter the username click on submit the message displayed is "null isrequired". Instead it should be "Username is required".The part of the code in the validator-rules.xml is correct. I have givenmsg="errors.required"Also I have given "errors.required={0} is required." "prompt.username=Username" in the ApplicationResources.properties file.Still it is giving the same alert as "null is required" instead of"Username" is required.The corresponding part in the validation.xml isfield property="username"depends="required, minlength,maxlength"arg0 key="prompt.username"/arg1 key="${var:minlength}" name="minlength"resource="false"/arg2 key="${var:maxlength}" name="maxlength"resource="false"/varvar-namemaxlength/var-namevar-value16/var-value/varvarvar-nameminlength/var-namevar-value3/var-value/var/fieldHas anybody experienced this problem earlier ?prashant.-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]. IncrediMail - Email has finally evolved - Click Here
Re: logic:iterate tag fails on large dataset, succeeds on small one?
I suggest you use the JSTL's c:forEach tag instead of the Struts iterate tag. I have dynamic query pages that use forEach and display n number of fields with no problem. As an added bonus you'll get improved page rendering time because containers can optimize the performance of JSTL tags. David --- Aaron Humphrey [EMAIL PROTECTED] wrote: I am trying to do a very simple data-display web application using Struts, with MySQL on the back end. Basically, I take a ResultSet and its ResultSetMetaData and put it into some beans. I have a TableDataView object which contains a FieldList and a RecordCollection. FieldList has a property called fields which returns a List. RecordCollection implements Collection, and containts an ArrayList of Record objects; Record returns an array of the field value objects as the property fieldValues. My JSP page(showtable.jsp)looks like: html:html TABLE TR logic:iterate id=fields name=tableDataView property=fieldList THbean:write name=fields //TH /logic:iterate /TR logic:iterate id=record name=tableDataView property=recordList TR logic:iterate id=fvalues name=record property=fieldValues TDbean:write name=fvalues //TD /logic:iterate /TR /logic:iterate /TABLE /html:html If I run this on a small table, with 10 fields and 11 records, it works fine. If I run it on a large table, with 28 fields and 307 records, then I get: javax.servlet.ServletException: cannot find bean fvalues in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCon textImpl.java:533) at org.apache.jsp.showtable_jsp._jspService(showtable_jsp.java:192) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) ...[deletia...I can't imagine that any of it has anything to do with my error] at java.lang.Thread.run(Thread.java:536) I can eliminate this problem if I reduce the number of fields in the table to 9 or 10, but I can't see why this should be a problem, and certainly not why my looping bean should suddenly become unavailable. My unit tests seem to be telling me that my Record bean should be properly returning a list of 28 field values. I don't know at what point things are breaking down. I'm not experienced with JSP tag programming, so I haven't been able to learn much from IterateTag.java, or the compiled version of showtable.jsp. Any pointers on my problem would be much appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate tag fails on large dataset, succeeds onsmall one?
[EMAIL PROTECTED] 07/21/03 12:00PM I suggest you use the JSTL's c:forEach tag instead of the Struts iterate tag. I have dynamic query pages that use forEach and display n number of fields with no problem. As an added bonus you'll get improved page rendering time because containers can optimize the performance of JSTL tags. Okay, I got JSTL 1.0 working on my machine(after giving up on 1.1, which is apparently too bleeding-edge). Replacing logic:iterate with c:forEach is straightforward. And I still get the same problem. Oh, the exception might come up on a different line of my compiled JSP, but the same thing is happening. Does this mean that it's no longer a Struts problem? Should I be asking these questions on a JSTL forum? Aaron V. Humphrey Kakari Systems Ltd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate tag fails on large dataset, succeeds on small one?
--- Aaron Humphrey [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] 07/21/03 12:00PM I suggest you use the JSTL's c:forEach tag instead of the Struts iterate tag. I have dynamic query pages that use forEach and display n number of fields with no problem. As an added bonus you'll get improved page rendering time because containers can optimize the performance of JSTL tags. Okay, I got JSTL 1.0 working on my machine(after giving up on 1.1, which is apparently too bleeding-edge). Replacing logic:iterate with c:forEach is straightforward. And I still get the same problem. Oh, the exception might come up on a different line of my compiled JSP, but the same thing is happening. Does this mean that it's no longer a Struts problem? Should I be asking these questions on a JSTL forum? If both JSTL and Struts are failing, it's probably your code that's broken. David Aaron V. Humphrey Kakari Systems Ltd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate tag revisited
On Fri, 7 Mar 2003 11:33:50 +1100 Steve Vanspall [EMAIL PROTECTED] wrote: Hi there Here's my problem, I have modelled my iterate tag on a working example I was given by a colleague. this is my jsp code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imfFile tr td align=rightbean:write name=imfFile property=id//tdtd align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr scriptnameArray[cnt] = '%=TemplateBeans.IMG_TMPLT%:bean:write name=imfFile property=id/'; cnt++; /script /logic:iterate when I run it I get javax.servlet.jsp.JspException: Cannot find bean imfFile in any scope are you sure it's not saying imgFile is not any scope??? If you look you named one of them imgFile and the other imfFile but I don't see where you ever declared the id imgFile ? Is imgFile declared somewhere else? Also, are you positive your list has IMGTemplateBeans in it? If you remove all the tr/tr stuff and just print out testBR in there do you get a bunch of tests printed out? Are you also positive that your imageFieldsList is being populated with the type com.crm.util.TemplateBeans.IMGTemplateBean You sure nothing is spelled wrong there..etc. ? I know a lot of this is probably obvious but it's always the obvious that gets me:) A mistyped letter or something. -- Rick Reumann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate tag revisited
Ah it's always the small thing, I can't beleive I missed that Thank you, I will procedd to kick myself several times Steve -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 11:51 AM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited On Fri, 7 Mar 2003 11:33:50 +1100 Steve Vanspall [EMAIL PROTECTED] wrote: Hi there Here's my problem, I have modelled my iterate tag on a working example I was given by a colleague. this is my jsp code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imfFile tr td align=rightbean:write name=imfFile property=id//tdtd align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr scriptnameArray[cnt] = '%=TemplateBeans.IMG_TMPLT%:bean:write name=imfFile property=id/'; cnt++; /script /logic:iterate when I run it I get javax.servlet.jsp.JspException: Cannot find bean imfFile in any scope are you sure it's not saying imgFile is not any scope??? If you look you named one of them imgFile and the other imfFile but I don't see where you ever declared the id imgFile ? Is imgFile declared somewhere else? Also, are you positive your list has IMGTemplateBeans in it? If you remove all the tr/tr stuff and just print out testBR in there do you get a bunch of tests printed out? Are you also positive that your imageFieldsList is being populated with the type com.crm.util.TemplateBeans.IMGTemplateBean You sure nothing is spelled wrong there..etc. ? I know a lot of this is probably obvious but it's always the obvious that gets me:) A mistyped letter or something. -- Rick Reumann - 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 tag revisited
Ok making some headway here, I have my logic:iterate tag working, but it doesn't do what I want it to this is my code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imgFile tr td align=rightbean:write name=imgFile property=description//td td align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr script cnt++; /script /logic:iterate now I want this to populate the original field it got the value from, when I submit the form. I can see why this won't do it, but can't work out if struts has a way of doing it for me Is there a way to get struts to iterate through a list, and then re iterate through thelist and make the necessary changes, by populating the IMGTemplateBean with the apporopriate formFile information Regards Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 12:42 PM To: Struts Users Mailing List Subject: RE: logic:iterate tag revisited Ah it's always the small thing, I can't beleive I missed that Thank you, I will procedd to kick myself several times Steve -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 11:51 AM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited On Fri, 7 Mar 2003 11:33:50 +1100 Steve Vanspall [EMAIL PROTECTED] wrote: Hi there Here's my problem, I have modelled my iterate tag on a working example I was given by a colleague. this is my jsp code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imfFile tr td align=rightbean:write name=imfFile property=id//tdtd align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr scriptnameArray[cnt] = '%=TemplateBeans.IMG_TMPLT%:bean:write name=imfFile property=id/'; cnt++; /script /logic:iterate when I run it I get javax.servlet.jsp.JspException: Cannot find bean imfFile in any scope are you sure it's not saying imgFile is not any scope??? If you look you named one of them imgFile and the other imfFile but I don't see where you ever declared the id imgFile ? Is imgFile declared somewhere else? Also, are you positive your list has IMGTemplateBeans in it? If you remove all the tr/tr stuff and just print out testBR in there do you get a bunch of tests printed out? Are you also positive that your imageFieldsList is being populated with the type com.crm.util.TemplateBeans.IMGTemplateBean You sure nothing is spelled wrong there..etc. ? I know a lot of this is probably obvious but it's always the obvious that gets me:) A mistyped letter or something. -- Rick Reumann - 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 tag revisited
I can't understand why you need to re-iterate . Do you need to do some update on a view page ? If yes you will need to have an action defined for that, then you will be redirect on an another page or update your change on a session scope (for example) From where the original value came ? The default value you define on your based ActionForm ? -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:01 AM Subject: RE: logic:iterate tag revisited Ok making some headway here, I have my logic:iterate tag working, but it doesn't do what I want it to this is my code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imgFile tr td align=rightbean:write name=imgFile property=description//td td align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr script cnt++; /script /logic:iterate now I want this to populate the original field it got the value from, when I submit the form. I can see why this won't do it, but can't work out if struts has a way of doing it for me Is there a way to get struts to iterate through a list, and then re iterate through thelist and make the necessary changes, by populating the IMGTemplateBean with the apporopriate formFile information Regards Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 12:42 PM To: Struts Users Mailing List Subject: RE: logic:iterate tag revisited Ah it's always the small thing, I can't beleive I missed that Thank you, I will procedd to kick myself several times Steve -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 11:51 AM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited On Fri, 7 Mar 2003 11:33:50 +1100 Steve Vanspall [EMAIL PROTECTED] wrote: Hi there Here's my problem, I have modelled my iterate tag on a working example I was given by a colleague. this is my jsp code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imfFile tr td align=rightbean:write name=imfFile property=id//tdtd align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr scriptnameArray[cnt] = '%=TemplateBeans.IMG_TMPLT%:bean:write name=imfFile property=id/'; cnt++; /script /logic:iterate when I run it I get javax.servlet.jsp.JspException: Cannot find bean imfFile in any scope are you sure it's not saying imgFile is not any scope??? If you look you named one of them imgFile and the other imfFile but I don't see where you ever declared the id imgFile ? Is imgFile declared somewhere else? Also, are you positive your list has IMGTemplateBeans in it? If you remove all the tr/tr stuff and just print out testBR in there do you get a bunch of tests printed out? Are you also positive that your imageFieldsList is being populated with the type com.crm.util.TemplateBeans.IMGTemplateBean You sure nothing is spelled wrong there..etc. ? I know a lot of this is probably obvious but it's always the obvious that gets me:) A mistyped letter or something. -- Rick Reumann - 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 tag revisited
ok this is the full story The value come from the form, the IMGTemplateFields object are in an ArrayList chich is stored in the 'imageFieldsList' field of my RenderHTMLForm I want to have struts iterate through that list. For wach occurence of an IMGTemplateBean I want to make a tag that will allow the user to enter the path of a file for upload. this will go into the 'file' field of the corresponding IMGTemplateBean. Now my problem is, when I submit the form, using the code mentioned in my previous message, it does not update the IMGTemplateBeans that the 'file' fields relate to. Not sure if I am trying to do something that struts can't do, or if I am just doing it wrong Regards Steve P.S. Alternatively how to I create a FormFile, with inputstream etc. from a string giving me the path of a file on the clients machine. -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:07 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited I can't understand why you need to re-iterate . Do you need to do some update on a view page ? If yes you will need to have an action defined for that, then you will be redirect on an another page or update your change on a session scope (for example) From where the original value came ? The default value you define on your based ActionForm ? -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:01 AM Subject: RE: logic:iterate tag revisited Ok making some headway here, I have my logic:iterate tag working, but it doesn't do what I want it to this is my code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imgFile tr td align=rightbean:write name=imgFile property=description//td td align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr script cnt++; /script /logic:iterate now I want this to populate the original field it got the value from, when I submit the form. I can see why this won't do it, but can't work out if struts has a way of doing it for me Is there a way to get struts to iterate through a list, and then re iterate through thelist and make the necessary changes, by populating the IMGTemplateBean with the apporopriate formFile information Regards Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 12:42 PM To: Struts Users Mailing List Subject: RE: logic:iterate tag revisited Ah it's always the small thing, I can't beleive I missed that Thank you, I will procedd to kick myself several times Steve -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 11:51 AM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited On Fri, 7 Mar 2003 11:33:50 +1100 Steve Vanspall [EMAIL PROTECTED] wrote: Hi there Here's my problem, I have modelled my iterate tag on a working example I was given by a colleague. this is my jsp code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imfFile tr td align=rightbean:write name=imfFile property=id//tdtd align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr scriptnameArray[cnt] = '%=TemplateBeans.IMG_TMPLT%:bean:write name=imfFile property=id/'; cnt++; /script /logic:iterate when I run it I get javax.servlet.jsp.JspException: Cannot find bean imfFile in any scope are you sure it's not saying imgFile is not any scope??? If you look you named one of them imgFile and the other imfFile but I don't see where you ever declared the id imgFile ? Is imgFile declared somewhere else? Also, are you positive your list has IMGTemplateBeans in it? If you remove all the tr/tr stuff and just print out testBR in there do you get a bunch of tests printed out? Are you also positive that your imageFieldsList is being populated with the type com.crm.util.TemplateBeans.IMGTemplateBean You sure nothing is spelled wrong there..etc. ? I know a lot of this is probably obvious but it's always the obvious that gets me:) A mistyped letter or something. -- Rick Reumann - 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 tag revisited
Yep struts cannot simply act as you wanna do. Before you can update your files path or everything else you will need to tell an action : Hey retrieve all the kinds of datas on a whole collection I will made some change on it First you got an view page who juste iterate your collection. and have a tag just as you say to will store some variables in your request. But one trouble I see is you are not in a windows like program, where you can just made some appropriate change and then pass it to whatever you want. If you wanna do your job, before you can send to an appropriate action, you will need to hit it by a client side programming. I'm not sure if you understand what I mean. -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:16 AM Subject: RE: logic:iterate tag revisited ok this is the full story The value come from the form, the IMGTemplateFields object are in an ArrayList chich is stored in the 'imageFieldsList' field of my RenderHTMLForm I want to have struts iterate through that list. For wach occurence of an IMGTemplateBean I want to make a tag that will allow the user to enter the path of a file for upload. this will go into the 'file' field of the corresponding IMGTemplateBean. Now my problem is, when I submit the form, using the code mentioned in my previous message, it does not update the IMGTemplateBeans that the 'file' fields relate to. Not sure if I am trying to do something that struts can't do, or if I am just doing it wrong Regards Steve P.S. Alternatively how to I create a FormFile, with inputstream etc. from a string giving me the path of a file on the clients machine. -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:07 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited I can't understand why you need to re-iterate . Do you need to do some update on a view page ? If yes you will need to have an action defined for that, then you will be redirect on an another page or update your change on a session scope (for example) From where the original value came ? The default value you define on your based ActionForm ? -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:01 AM Subject: RE: logic:iterate tag revisited Ok making some headway here, I have my logic:iterate tag working, but it doesn't do what I want it to this is my code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imgFile tr td align=rightbean:write name=imgFile property=description//td td align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr script cnt++; /script /logic:iterate now I want this to populate the original field it got the value from, when I submit the form. I can see why this won't do it, but can't work out if struts has a way of doing it for me Is there a way to get struts to iterate through a list, and then re iterate through thelist and make the necessary changes, by populating the IMGTemplateBean with the apporopriate formFile information Regards Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 12:42 PM To: Struts Users Mailing List Subject: RE: logic:iterate tag revisited Ah it's always the small thing, I can't beleive I missed that Thank you, I will procedd to kick myself several times Steve -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 11:51 AM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited On Fri, 7 Mar 2003 11:33:50 +1100 Steve Vanspall [EMAIL PROTECTED] wrote: Hi there Here's my problem, I have modelled my iterate tag on a working example I was given by a colleague. this is my jsp code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imfFile tr td align=rightbean:write name=imfFile property=id//tdtd align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr scriptnameArray[cnt] = '%=TemplateBeans.IMG_TMPLT%:bean:write name=imfFile property=id/'; cnt++; /script /logic:iterate when I run it I get javax.servlet.jsp.JspException: Cannot find bean imfFile in any scope are you sure it's not saying imgFile is not any scope??? If you look you named one of them imgFile and the other imfFile but I don't see where you ever declared the id imgFile
RE: logic:iterate tag revisited
Yeah that's col, I figured I would have to do that. that's the way I originally was going to do it, This then leads me to my next question, which was in the p.s. of my previous post, how does struts create a formfile for upload form the path entered by the user. My problem is, there could be any number of image files needing uploading, depending on the strutcture of the template they are going into. Hence, I can't just have a fixed number of FormFile fields in my form. So when the user submits the file details, I want to be able to upload that file to the server, then process it from there. How do I do that. There isn't much info about uploading a dynamic number of files to the serve using struts. Steve -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:34 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited Yep struts cannot simply act as you wanna do. Before you can update your files path or everything else you will need to tell an action : Hey retrieve all the kinds of datas on a whole collection I will made some change on it First you got an view page who juste iterate your collection. and have a tag just as you say to will store some variables in your request. But one trouble I see is you are not in a windows like program, where you can just made some appropriate change and then pass it to whatever you want. If you wanna do your job, before you can send to an appropriate action, you will need to hit it by a client side programming. I'm not sure if you understand what I mean. -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:16 AM Subject: RE: logic:iterate tag revisited ok this is the full story The value come from the form, the IMGTemplateFields object are in an ArrayList chich is stored in the 'imageFieldsList' field of my RenderHTMLForm I want to have struts iterate through that list. For wach occurence of an IMGTemplateBean I want to make a tag that will allow the user to enter the path of a file for upload. this will go into the 'file' field of the corresponding IMGTemplateBean. Now my problem is, when I submit the form, using the code mentioned in my previous message, it does not update the IMGTemplateBeans that the 'file' fields relate to. Not sure if I am trying to do something that struts can't do, or if I am just doing it wrong Regards Steve P.S. Alternatively how to I create a FormFile, with inputstream etc. from a string giving me the path of a file on the clients machine. -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:07 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited I can't understand why you need to re-iterate . Do you need to do some update on a view page ? If yes you will need to have an action defined for that, then you will be redirect on an another page or update your change on a session scope (for example) From where the original value came ? The default value you define on your based ActionForm ? -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:01 AM Subject: RE: logic:iterate tag revisited Ok making some headway here, I have my logic:iterate tag working, but it doesn't do what I want it to this is my code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imgFile tr td align=rightbean:write name=imgFile property=description//td td align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr script cnt++; /script /logic:iterate now I want this to populate the original field it got the value from, when I submit the form. I can see why this won't do it, but can't work out if struts has a way of doing it for me Is there a way to get struts to iterate through a list, and then re iterate through thelist and make the necessary changes, by populating the IMGTemplateBean with the apporopriate formFile information Regards Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 12:42 PM To: Struts Users Mailing List Subject: RE: logic:iterate tag revisited Ah it's always the small thing, I can't beleive I missed that Thank you, I will procedd to kick myself several times Steve -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 11:51 AM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited On Fri, 7 Mar 2003 11:33:50 +1100 Steve Vanspall [EMAIL PROTECTED] wrote: Hi
Re: logic:iterate tag revisited
I never had that case but you may have a look at the http://jakarta.apache.org/struts/api/org/apache/struts/upload/package-use.ht ml (never try) -- Alexandre Jaquet You can get the source code of this taglib on the wrox web site. - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:49 AM Subject: RE: logic:iterate tag revisited Yeah that's col, I figured I would have to do that. that's the way I originally was going to do it, This then leads me to my next question, which was in the p.s. of my previous post, how does struts create a formfile for upload form the path entered by the user. My problem is, there could be any number of image files needing uploading, depending on the strutcture of the template they are going into. Hence, I can't just have a fixed number of FormFile fields in my form. So when the user submits the file details, I want to be able to upload that file to the server, then process it from there. How do I do that. There isn't much info about uploading a dynamic number of files to the serve using struts. Steve -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:34 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited Yep struts cannot simply act as you wanna do. Before you can update your files path or everything else you will need to tell an action : Hey retrieve all the kinds of datas on a whole collection I will made some change on it First you got an view page who juste iterate your collection. and have a tag just as you say to will store some variables in your request. But one trouble I see is you are not in a windows like program, where you can just made some appropriate change and then pass it to whatever you want. If you wanna do your job, before you can send to an appropriate action, you will need to hit it by a client side programming. I'm not sure if you understand what I mean. -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:16 AM Subject: RE: logic:iterate tag revisited ok this is the full story The value come from the form, the IMGTemplateFields object are in an ArrayList chich is stored in the 'imageFieldsList' field of my RenderHTMLForm I want to have struts iterate through that list. For wach occurence of an IMGTemplateBean I want to make a tag that will allow the user to enter the path of a file for upload. this will go into the 'file' field of the corresponding IMGTemplateBean. Now my problem is, when I submit the form, using the code mentioned in my previous message, it does not update the IMGTemplateBeans that the 'file' fields relate to. Not sure if I am trying to do something that struts can't do, or if I am just doing it wrong Regards Steve P.S. Alternatively how to I create a FormFile, with inputstream etc. from a string giving me the path of a file on the clients machine. -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:07 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited I can't understand why you need to re-iterate . Do you need to do some update on a view page ? If yes you will need to have an action defined for that, then you will be redirect on an another page or update your change on a session scope (for example) From where the original value came ? The default value you define on your based ActionForm ? -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:01 AM Subject: RE: logic:iterate tag revisited Ok making some headway here, I have my logic:iterate tag working, but it doesn't do what I want it to this is my code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imgFile tr td align=rightbean:write name=imgFile property=description//td td align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr script cnt++; /script /logic:iterate now I want this to populate the original field it got the value from, when I submit the form. I can see why this won't do it, but can't work out if struts has a way of doing it for me Is there a way to get struts to iterate through a list, and then re iterate through thelist and make the necessary changes, by populating the IMGTemplateBean with the apporopriate formFile information Regards Steve -Original Message- From: Steve Vanspall [mailto
Re: logic:iterate tag revisited
a better page : http://jakarta.apache.org/struts/faqs/actionForm.html -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:49 AM Subject: RE: logic:iterate tag revisited Yeah that's col, I figured I would have to do that. that's the way I originally was going to do it, This then leads me to my next question, which was in the p.s. of my previous post, how does struts create a formfile for upload form the path entered by the user. My problem is, there could be any number of image files needing uploading, depending on the strutcture of the template they are going into. Hence, I can't just have a fixed number of FormFile fields in my form. So when the user submits the file details, I want to be able to upload that file to the server, then process it from there. How do I do that. There isn't much info about uploading a dynamic number of files to the serve using struts. Steve -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:34 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited Yep struts cannot simply act as you wanna do. Before you can update your files path or everything else you will need to tell an action : Hey retrieve all the kinds of datas on a whole collection I will made some change on it First you got an view page who juste iterate your collection. and have a tag just as you say to will store some variables in your request. But one trouble I see is you are not in a windows like program, where you can just made some appropriate change and then pass it to whatever you want. If you wanna do your job, before you can send to an appropriate action, you will need to hit it by a client side programming. I'm not sure if you understand what I mean. -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:16 AM Subject: RE: logic:iterate tag revisited ok this is the full story The value come from the form, the IMGTemplateFields object are in an ArrayList chich is stored in the 'imageFieldsList' field of my RenderHTMLForm I want to have struts iterate through that list. For wach occurence of an IMGTemplateBean I want to make a tag that will allow the user to enter the path of a file for upload. this will go into the 'file' field of the corresponding IMGTemplateBean. Now my problem is, when I submit the form, using the code mentioned in my previous message, it does not update the IMGTemplateBeans that the 'file' fields relate to. Not sure if I am trying to do something that struts can't do, or if I am just doing it wrong Regards Steve P.S. Alternatively how to I create a FormFile, with inputstream etc. from a string giving me the path of a file on the clients machine. -Original Message- From: alexj [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 2:07 PM To: Struts Users Mailing List Subject: Re: logic:iterate tag revisited I can't understand why you need to re-iterate . Do you need to do some update on a view page ? If yes you will need to have an action defined for that, then you will be redirect on an another page or update your change on a session scope (for example) From where the original value came ? The default value you define on your based ActionForm ? -- Alexandre Jaquet - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:01 AM Subject: RE: logic:iterate tag revisited Ok making some headway here, I have my logic:iterate tag working, but it doesn't do what I want it to this is my code logic:iterate name=RenderHTMLForm type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFieldsList id=imgFile tr td align=rightbean:write name=imgFile property=description//td td align=lefthtml:file name=imgFile property=file accept=image/gif,image/jpeg//td /tr script cnt++; /script /logic:iterate now I want this to populate the original field it got the value from, when I submit the form. I can see why this won't do it, but can't work out if struts has a way of doing it for me Is there a way to get struts to iterate through a list, and then re iterate through thelist and make the necessary changes, by populating the IMGTemplateBean with the apporopriate formFile information Regards Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 12:42 PM To: Struts Users Mailing List Subject: RE: logic:iterate tag revisited
RE: logic:iterate -tag
You *can* use bean:define. Be sure to look at the docs at http://jakarta.apache.org/struts/userGuide/struts-bean.html#define; it explains how this tag differs from jsp:useBean. Sri -Original Message- From: Matthias Weßendorf [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 2:59 AM To: Struts Users Mailing List Subject: AW: logic:iterate -tag thank you, is it possible to create a bean with the bean:define ...-tag? or must i you the jsp:useBean ...-Tag? greetings Matthias Matthias Weßendorf Lange Strasse 17 D-44137 Dortmund Tel.: (02 31) 1 89 15 95 Handy: (01 79) 1 11 89 79 Email: mailto:[EMAIL PROTECTED] URL: http://www.wessendorf.NET -Ursprüngliche Nachricht- Von: David M. Karr [mailto:[EMAIL PROTECTED]] Gesendet: Sonntag, 12. Januar 2003 23:26 An: [EMAIL PROTECTED] Betreff: Re: logic:iterate -tag Matthias == Matthias Weßendorf [EMAIL PROTECTED] writes: Matthias Hello everybody, Matthias i am just trying to use the logic:iterate ...-Tag Matthias this way was successfull: Matthias THE CODE: Matthias %@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean % Matthias %@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic % Matthias jsp:useBean id=menge class=access.Glossarbegriffsverwaltung Matthias scope=request/ Matthias logic:iterate id=begriff name=menge property=begriffe Matthias bean:write name=begriff/br Matthias /logic:iterate Matthias END OF CODE Matthias but i didn´t want to use the jsp:useBean ...-Tag Matthias so i tried this one: Matthias THE CODE: Matthias %@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean % Matthias %@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic % Matthias logic:iterate id=begriff name=menge property=begriffe Matthias type=access.Glossarbegriffsverwaltung Matthias bean:write name=begriff/br Matthias /logic:iterate Matthias END OF CODE Matthias but i get this error: Matthias org.apache.jasper.JasperException: Cannot find bean menge in scope null No surprise here. The logic:iterate tag doesn't create beans, it just references them. The error message says it can't find a bean named menge because you never created it. You either have to use jsp:useBean or have the bean put into the request scope in the action that forwards to this jsp. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP; SCWCD -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate -tag
Matthias == Matthias Weßendorf [EMAIL PROTECTED] writes: Matthias Hello everybody, Matthias i am just trying to use the logic:iterate ...-Tag Matthias this way was successfull: Matthias THE CODE: Matthias %@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean % Matthias %@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic % Matthias jsp:useBean id=menge class=access.Glossarbegriffsverwaltung Matthias scope=request/ Matthias logic:iterate id=begriff name=menge property=begriffe Matthias bean:write name=begriff/br Matthias /logic:iterate Matthias END OF CODE Matthias but i didn´t want to use the jsp:useBean ...-Tag Matthias so i tried this one: Matthias THE CODE: Matthias %@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean % Matthias %@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic % Matthias logic:iterate id=begriff name=menge property=begriffe Matthias type=access.Glossarbegriffsverwaltung Matthias bean:write name=begriff/br Matthias /logic:iterate Matthias END OF CODE Matthias but i get this error: Matthias org.apache.jasper.JasperException: Cannot find bean menge in scope null No surprise here. The logic:iterate tag doesn't create beans, it just references them. The error message says it can't find a bean named menge because you never created it. You either have to use jsp:useBean or have the bean put into the request scope in the action that forwards to this jsp. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP; SCWCD -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate tag
Can you give me a little more info about the error ?? On Tue, 19 Feb 2002 08:30:40 -0500 (EST) Henry Lu [EMAIL PROTECTED] wrote: Could someone tell me why the following code doesn't work? How to make it work? public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate tag
You will need to use the nested tag or indexed tag for the values to be changed on the form. From: Henry Lu [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: struts users [EMAIL PROTECTED] Subject: logic:iterate tag Date: Tue, 19 Feb 2002 08:30:40 -0500 (EST) Could someone tell me why the following code doesn't work? How to make it work? public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate tag
How? --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On Tue, 19 Feb 2002, SUPRIYA MISRA wrote: You will need to use the nested tag or indexed tag for the values to be changed on the form. From: Henry Lu [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: struts users [EMAIL PROTECTED] Subject: logic:iterate tag Date: Tue, 19 Feb 2002 08:30:40 -0500 (EST) Could someone tell me why the following code doesn't work? How to make it work? public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate tag
I don't remember the error exactly but something like Servlet errors. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On 19 Feb 2002 [EMAIL PROTECTED] wrote: Can you give me a little more info about the error ?? On Tue, 19 Feb 2002 08:30:40 -0500 (EST) Henry Lu [EMAIL PROTECTED] wrote: Could someone tell me why the following code doesn't work? How to make it work? public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate tag
Thanks all. I figured out. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On Tue, 19 Feb 2002, Keith wrote: Could I suggest you slow down do some study experimentation? Struts is hard work in the early stages, but you have to go thru it. From a very quick look one thing is your ArrayList needs to contain a class that has get/set methods for it's properties. You've set them like m.id=123; m.name=John; when it should be m.setId(123); struts will call the String getId() methoid to get the value to display. Also in the iterate tag's type=... you must specify the type of the object in each elemnt of your ArrayList ie/ type=MyClass. --- Henry Lu [EMAIL PROTECTED] wrote: I don't remember the error exactly but something like Servlet errors. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On 19 Feb 2002 [EMAIL PROTECTED] wrote: Can you give me a little more info about the error ?? On Tue, 19 Feb 2002 08:30:40 -0500 (EST) Henry Lu [EMAIL PROTECTED] wrote: Could someone tell me why the following code doesn't work? How to make it work? public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate tag
Complementing, you don't need to specify the iterate tag's type attribute if you are using the bean:write tag (which uses reflection to get the properties). Fernando - Original Message - From: Keith [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, February 19, 2002 11:32 AM Subject: Re: logic:iterate tag Could I suggest you slow down do some study experimentation? Struts is hard work in the early stages, but you have to go thru it. From a very quick look one thing is your ArrayList needs to contain a class that has get/set methods for it's properties. You've set them like m.id=123; m.name=John; when it should be m.setId(123); struts will call the String getId() methoid to get the value to display. Also in the iterate tag's type=... you must specify the type of the object in each elemnt of your ArrayList ie/ type=MyClass. --- Henry Lu [EMAIL PROTECTED] wrote: I don't remember the error exactly but something like Servlet errors. -- - Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On 19 Feb 2002 [EMAIL PROTECTED] wrote: Can you give me a little more info about the error ?? On Tue, 19 Feb 2002 08:30:40 -0500 (EST) Henry Lu [EMAIL PROTECTED] wrote: Could someone tell me why the following code doesn't work? How to make it work? /// / public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: logic:iterate tag
Henry, I do have the same problem. Could you please post the solution. TIA, Jerome. -Original Message- From: Henry Lu [mailto:[EMAIL PROTECTED]] Sent: 19 February 2002 14:37 To: Struts Users Mailing List Subject: Re: logic:iterate tag Thanks all. I figured out. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On Tue, 19 Feb 2002, Keith wrote: Could I suggest you slow down do some study experimentation? Struts is hard work in the early stages, but you have to go thru it. From a very quick look one thing is your ArrayList needs to contain a class that has get/set methods for it's properties. You've set them like m.id=123; m.name=John; when it should be m.setId(123); struts will call the String getId() methoid to get the value to display. Also in the iterate tag's type=... you must specify the type of the object in each elemnt of your ArrayList ie/ type=MyClass. --- Henry Lu [EMAIL PROTECTED] wrote: I don't remember the error exactly but something like Servlet errors. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On 19 Feb 2002 [EMAIL PROTECTED] wrote: Can you give me a little more info about the error ?? On Tue, 19 Feb 2002 08:30:40 -0500 (EST) Henry Lu [EMAIL PROTECTED] wrote: Could someone tell me why the following code doesn't work? How to make it work? /// / public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: logic:iterate tag
I just recompile all codes. I think I didn't recompile one java code. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On Tue, 19 Feb 2002, Jerome Josephraj wrote: Henry, I do have the same problem. Could you please post the solution. TIA, Jerome. -Original Message- From: Henry Lu [mailto:[EMAIL PROTECTED]] Sent: 19 February 2002 14:37 To: Struts Users Mailing List Subject: Re: logic:iterate tag Thanks all. I figured out. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On Tue, 19 Feb 2002, Keith wrote: Could I suggest you slow down do some study experimentation? Struts is hard work in the early stages, but you have to go thru it. From a very quick look one thing is your ArrayList needs to contain a class that has get/set methods for it's properties. You've set them like m.id=123; m.name=John; when it should be m.setId(123); struts will call the String getId() methoid to get the value to display. Also in the iterate tag's type=... you must specify the type of the object in each elemnt of your ArrayList ie/ type=MyClass. --- Henry Lu [EMAIL PROTECTED] wrote: I don't remember the error exactly but something like Servlet errors. --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On 19 Feb 2002 [EMAIL PROTECTED] wrote: Can you give me a little more info about the error ?? On Tue, 19 Feb 2002 08:30:40 -0500 (EST) Henry Lu [EMAIL PROTECTED] wrote: Could someone tell me why the following code doesn't work? How to make it work? /// / public class MyClass_1 { ... } /// public class MyClass_2 extends MyClass_1 { ... public ArrayList runList() { Arraylist lst = new ArrayList(); MyClass m; m.id=123; m.name=John; lst.add(m); return lst; } } /// public class MyForm extends ActionForm ( ... private ArrayList lst; public ArrayList getLst() { MyClass_2 m2; this.lst = m2.runList(); return this.lst; } public void setLst(ArrayList lst) { this.lst = lst; } } // table logic:iterate id=theList name=MyForm property=lst type=MyClass_2 trtd bean:write name=theList property=id/ /tdtd bean:write name=theList property=name/ /td/tr /logic:iterate /table --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed