CheckBox and Boolean[] Array - Incorrect Values Submitted When CheckBox is unchecked
Hi, I'm trying to iterate through a Boolean Array using logic:iterate and then display these as check boxes. This works fine, but when submitting the form and resending the Boolean Array back to the Action class, only the values that are true are returned. In the struts documentation it says: WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method. But this only implies for a single property. Is there a workaround or a fix for this? My jsp code: logic:iterate id=flag name=myForm property=flags logic:equal name= flag value=true input type=checkbox id=flags name=flags value=on checked=checked /logic:equal logic:notEqual name= flag value=true input type=checkbox id=flags name=flags value=on /logic:notEqual /logic:iterate Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: CheckBox and Boolean[] Array - Incorrect Values Submitted Whe n CheckBox is unchecked
If that is the case, then why does it work with single boolean properties? I only get this problem when working with an array. Chico -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: 04 October 2002 13:12 To: 'Struts Users Mailing List' Subject: RE: CheckBox and Boolean[] Array - Incorrect Values Submitted Whe n Ch eckBox is unchecked This is by design and you will have to write some code to accommodate it. The HTML spec mandates that no request values are passed for unchecked checkboxes, so you will have to keep track of the checkboxes yourself. What I do is type the checkboxes as String rather than boolean in the ActionForm and track true and false through the iterator. Mark -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 7:11 AM To: 'Struts Users Mailing List' Subject: CheckBox and Boolean[] Array - Incorrect Values Submitted When Ch eckBox is unchecked Hi, I'm trying to iterate through a Boolean Array using logic:iterate and then display these as check boxes. This works fine, but when submitting the form and resending the Boolean Array back to the Action class, only the values that are true are returned. In the struts documentation it says: WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method. But this only implies for a single property. Is there a workaround or a fix for this? My jsp code: logic:iterate id=flag name=myForm property=flags logic:equal name= flag value=true input type=checkbox id=flags name=flags value=on checked=checked /logic:equal logic:notEqual name= flag value=true input type=checkbox id=flags name=flags value=on /logic:notEqual /logic:iterate Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- 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] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: CheckBox and Boolean[] Array - Incorrect Values Submitted Whe n CheckBox is unchecked
Yeah of course I gotcha now ... Cheers chico -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: 04 October 2002 13:26 To: 'Struts Users Mailing List' Subject: RE: CheckBox and Boolean[] Array - Incorrect Values Submitted Whe n CheckBox is unchecked I'm not sure what you mean. If a checkbox or radio button is not checked, it has NO state. This means boolean false is never passed. Only boolean trues are passed in the request object. If you are defining individual objects as boolean in your ActionForm, the JVM assigns their state to false by default, so any individual object that is passed in the request object will be true and change the state accordingly. It may look like your form is setting your ActionForm booleans to false, but it is not - the JVM is. This is why it won't work with an array - the JVM sets arrays to null by default. Mark -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 8:18 AM To: 'Struts Users Mailing List' Subject: RE: CheckBox and Boolean[] Array - Incorrect Values Submitted Whe n CheckBox is unchecked If that is the case, then why does it work with single boolean properties? I only get this problem when working with an array. Chico -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: 04 October 2002 13:12 To: 'Struts Users Mailing List' Subject: RE: CheckBox and Boolean[] Array - Incorrect Values Submitted Whe n Ch eckBox is unchecked This is by design and you will have to write some code to accommodate it. The HTML spec mandates that no request values are passed for unchecked checkboxes, so you will have to keep track of the checkboxes yourself. What I do is type the checkboxes as String rather than boolean in the ActionForm and track true and false through the iterator. Mark -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 7:11 AM To: 'Struts Users Mailing List' Subject: CheckBox and Boolean[] Array - Incorrect Values Submitted When Ch eckBox is unchecked Hi, I'm trying to iterate through a Boolean Array using logic:iterate and then display these as check boxes. This works fine, but when submitting the form and resending the Boolean Array back to the Action class, only the values that are true are returned. In the struts documentation it says: WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method. But this only implies for a single property. Is there a workaround or a fix for this? My jsp code: logic:iterate id=flag name=myForm property=flags logic:equal name= flag value=true input type=checkbox id=flags name=flags value=on checked=checked /logic:equal logic:notEqual name= flag value=true input type=checkbox id=flags name=flags value=on /logic:notEqual /logic:iterate Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- 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] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- 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] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: CheckBox and Boolean[] Array - Incorrect Values Submitted When CheckBox is unchecked
Sorted!! Got a String[] (checkboxes), and when form is submitted the positions of the checked checkboxes are sent in this array ... % int i = 0; % logic:iterate id=flag name=myForm property=flags logic:equal name= flag value=true input type=checkbox id=checkboxes name=checkboxes value=%=new Integer(i).toString()% checked=checked /logic:equal logic:notEqual name=flag value=true input type=checkbox id=checkboxes name=checkboxes value=%=new Integer(i).toString()% /logic:notEqual % i++; % /logic:iterate Cheers, Chico. Ps. U guys r nutz, leave the telepathic powers at home!! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: 04 October 2002 13:42 To: Struts Users Mailing List Subject: RE: CheckBox and Boolean[] Array - Incorrect Values Submitted When CheckBox is unchecked Wrote it before I read yours. Just had a beer and a GT so my telepathic powers must have come online as a result ;-) Ahhh... I do so love Fridays. -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 20:21 To: 'Struts Users Mailing List' Subject: RE: CheckBox and Boolean[] Array - Incorrect Values Submitted When CheckBox is unchecked Hey man! RU refactoring my messages? ;-) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 8:17 AM To: Struts Users Mailing List Subject: RE: CheckBox and Boolean[] Array - Incorrect Values Submitted When CheckBox is unchecked For multiple, you also must set values back to false in reset() (The question here of course is which checkbox refers to which element. You may need to refactor such that your checkboxes return non boolean values so you can tell which is which at the server end). The reason for this is that the html spec in all its gory... uh I mean glory... has in its infinite wisdom defined that a checkbox ( radio button I think) that has not been ticked will not submit any value to the server. Afaik same is true for SELECT btw (multiple selections where nothing selected) -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 19:11 To: 'Struts Users Mailing List' Subject: CheckBox and Boolean[] Array - Incorrect Values Submitted When CheckBox is unchecked Hi, I'm trying to iterate through a Boolean Array using logic:iterate and then display these as check boxes. This works fine, but when submitting the form and resending the Boolean Array back to the Action class, only the values that are true are returned. In the struts documentation it says: WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method. But this only implies for a single property. Is there a workaround or a fix for this? My jsp code: logic:iterate id=flag name=myForm property=flags logic:equal name= flag value=true input type=checkbox id=flags name=flags value=on checked=checked /logic:equal logic:notEqual name= flag value=true input type=checkbox id=flags name=flags value=on /logic:notEqual /logic:iterate Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Getting Weird Message From Application ResourcesProperties Fi le
Cheers, works like a dream ... Chico. -Original Message- From: Homer, Christopher [mailto:[EMAIL PROTECTED]] Sent: 22 May 2002 16:40 To: 'Struts Users Mailing List' Subject: RE: Getting Weird Message From Application ResourcesProperties Fi le I had this a while ago and think I fixed it by adding... errors.header= errors.footer= ...to the resource file. Chris -Original Message- From: Yan Fei [mailto:[EMAIL PROTECTED]] Sent: 22 May 2002 16:37 To: [EMAIL PROTECTED] Subject: Re: Getting Weird Message From Application ResourcesProperties File i got same problem, don't know why. yan [EMAIL PROTECTED] 05/22/02 10:33AM For some reason when using the struts bean:message tag to get a message it then displays it on the screen has: null Test Message null It adds null to the start and end of my message ... Anyone else come across this problem? Cheers, Chico. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: 22 May 2002 16:26 To: Struts Users Mailing List Subject: Re: html taglib usage slooow Seems like I've seen posts where people say that switching to the IBM JVM can make a difference. [EMAIL PROTECTED] wrote: This topic comes up from time to time and it seems that I am never happy with the solution(s). There seems to be two main answers: 1 - do not use so many tags. 2 - find an Servlet Container that will handle tags in a speedy manner. Have I missed any? As for answer one - I am currently beginning the design stage of a project that will use struts ( our first one) and am looking forward to finding tags that clean up my code. I could probably get away with not using the bean write tags for all my labels but I am experimenting with the format attribute for currency and dates ect. It seems that fifty tags is a number that comes up from time to time. How does looping over tags factor into this? As for answer two: - Craig mentioned in this post that the nightly build of tomcat handles this much better. The nightly build thing will be a tough sell for me. Is there a particular production container that (at this time) is known for it's efficient tag handling (code generation, pooling ect) ? Summary: We are doing an internal A/R application. If you include labels, it is not hard to exceed 50 tags. I would be disappointed to find out that I cannot make use of the full power of Struts, and have to replace some tags with a scriplets. But at the same time I would like to know of some of these issues that I might face. Thanks. Victor Hadianto [EMAIL PROTECTED] on 05/21/2002 06:33:07 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject: Re: html taglib usage slooow On Wed, 22 May 2002 02:11, you wrote: On Tue, May 21, 2002 at 12:01:06PM -0400, Galbreath, Mark wrote: Precompile the JSP. Have tried that, does not help. Even after compiling, it's really slow. This is not going to work .. read on . It seems, the problem is within the taglib implementation - either in the appserver or within struts. Erich, I have posted the similar issue weeks ago in the mailing list. We too found that the use of html:taglibs are really slow. After running the profiler we found that (in our case) the primary slowdown spot is the bean:write tag. We have hundreds of this tag in our page (it's a really complex page I assure you). Drilling down again to find the root cause I found the problem was that bean:write tags call request.getLocale(). request.getLocale(), for some reason we couldn't fathom, took ages to execute. This is why, in our situation, that the rendering of the page takes in average 80% of the time, even longer than multiple server roundtrips to the EJB server, action class logic and some other overheads. grrr . -- Victor Hadianto -- 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] -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] For optimum solutions that save you time, visit www.ds-s.com. -- To unsubscribe, e-mail:
RE: JRUN 4 PROBLEMS WITH STRUTS 1.0
Cheers matey Everything is peachy n golden now Chico. -Original Message- From: Arron Bates [mailto:[EMAIL PROTECTED]] Sent: 17 May 2002 17:00 To: Struts Users Mailing List Subject: Re: JRUN 4 PROBLEMS WITH STRUTS 1.0 You've migrated on, and trying to run a legacy copy of servlet.jar somewhere. I get it at work when a rogue version of the jar gets in there. Update it (or even try removing it temporarily, as JRun should have it's own), and you should be golden. Arron. Charlesworth, Chico wrote: I've downloaded the new version of JRUN version 4 and I get the following error(s) when rendering a simple JSP with some struts tags in it: 72. } while(_tag1.doAfterBody() == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN); - *** Error: No method named doAfterBody was found in type org/apache/struts/taglib/bean/WriteTag. 72. } while(_tag1.doAfterBody() == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN); -- *** Error: No field named EVAL_BODY_AGAIN was found in type javax/servlet/jsp/tagext/BodyTag. I don't get this problem with Jrun 3.1, so does anyone got any ideas, or has anyone had similar/other problems migrating to Jrun 4 with struts??? Cheers, Chico. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JRUN 4 PROBLEMS WITH STRUTS 1.0
I've downloaded the new version of JRUN version 4 and I get the following error(s) when rendering a simple JSP with some struts tags in it: 72. } while(_tag1.doAfterBody() == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN); - *** Error: No method named doAfterBody was found in type org/apache/struts/taglib/bean/WriteTag. 72. } while(_tag1.doAfterBody() == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN); -- *** Error: No field named EVAL_BODY_AGAIN was found in type javax/servlet/jsp/tagext/BodyTag. I don't get this problem with Jrun 3.1, so does anyone got any ideas, or has anyone had similar/other problems migrating to Jrun 4 with struts??? Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: JRUN 4 PROBLEMS WITH STRUTS 1.0
No stray } in my jsp, and I don't think that would be the likely cause of this error?? chico -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: 17 May 2002 16:33 To: Struts Users Mailing List Subject: RE: JRUN 4 PROBLEMS WITH STRUTS 1.0 Check for stray } in your jsp. JM -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Friday, May 17, 2002 11:22 AM To: 'Struts Users Mailing List' Subject: JRUN 4 PROBLEMS WITH STRUTS 1.0 I've downloaded the new version of JRUN version 4 and I get the following error(s) when rendering a simple JSP with some struts tags in it: 72. } while(_tag1.doAfterBody() == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN); - *** Error: No method named doAfterBody was found in type org/apache/struts/taglib/bean/WriteTag. 72. } while(_tag1.doAfterBody() == javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN); -- *** Error: No field named EVAL_BODY_AGAIN was found in type javax/servlet/jsp/tagext/BodyTag. I don't get this problem with Jrun 3.1, so does anyone got any ideas, or has anyone had similar/other problems migrating to Jrun 4 with struts??? Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Populating complex java objects in forms
Hi, If I've got a complex java object (i.e Customer) in the Form class, I can then read off this object in the jsp page, but when submitting to the Action class the Customer object is null. The jsp would look like: html:form action=/updateCustomer Customer Name: html:text property=customer.name/ br a href=javascript:document.forms[0].submit();Update Customer/a /html:form So this would display the current customer name, but if I change the customer name and then hit the submit link, I find the customer instance is now null in the updateCustomer action class. Am I doing something wrong, or is it not possible to populate complex java objects in the jsp form using struts? Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Populating complex java objects in forms
ive got my getter and setter methods in my formbean ... any other ideas? chico -Original Message- From: Ronald Haring [mailto:[EMAIL PROTECTED]] Sent: 07 March 2002 17:04 To: 'Struts Users Mailing List' Subject: RE: Populating complex java objects in forms yes you can do that but do you have a getCustomer() and setCustomer() method in your formbean? Gr Ronald -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 5:56 PM To: 'Struts Users Mailing List' Subject: Populating complex java objects in forms Hi, If I've got a complex java object (i.e Customer) in the Form class, I can then read off this object in the jsp page, but when submitting to the Action class the Customer object is null. The jsp would look like: html:form action=/updateCustomer Customer Name: html:text property=customer.name/ br a href=javascript:document.forms[0].submit();Update Customer/a /html:form So this would display the current customer name, but if I change the customer name and then hit the submit link, I find the customer instance is now null in the updateCustomer action class. Am I doing something wrong, or is it not possible to populate complex java objects in the jsp form using struts? Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer --- -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Populating complex java objects in forms
The scope is request, which should be ok, and other form fields that are Strings or String Arrays are populated ok, but not complex objects like Customer. Any other suggestions? -Original Message- From: Oliver Reflé [mailto:[EMAIL PROTECTED]] Sent: 07 March 2002 17:10 To: Struts Users Mailing List Subject: AW: Populating complex java objects in forms maybe check the scope of your form beans, maybe the one in the form is held in the session, and the one your action is expection should be in the request. If that happens struts generates a new form bean which is empty. -Ursprüngliche Nachricht- Von: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 7. März 2002 18:08 An: 'Struts Users Mailing List' Betreff: RE: Populating complex java objects in forms ive got my getter and setter methods in my formbean ... any other ideas? chico -Original Message- From: Ronald Haring [mailto:[EMAIL PROTECTED]] Sent: 07 March 2002 17:04 To: 'Struts Users Mailing List' Subject: RE: Populating complex java objects in forms yes you can do that but do you have a getCustomer() and setCustomer() method in your formbean? Gr Ronald -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 5:56 PM To: 'Struts Users Mailing List' Subject: Populating complex java objects in forms Hi, If I've got a complex java object (i.e Customer) in the Form class, I can then read off this object in the jsp page, but when submitting to the Action class the Customer object is null. The jsp would look like: html:form action=/updateCustomer Customer Name: html:text property=customer.name/ br a href=javascript:document.forms[0].submit();Update Customer/a /html:form So this would display the current customer name, but if I change the customer name and then hit the submit link, I find the customer instance is now null in the updateCustomer action class. Am I doing something wrong, or is it not possible to populate complex java objects in the jsp form using struts? Cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer --- -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- 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] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Passing a collection (ArrayList or string array) to the Action class from the jsp page ...
Hi, I'm trying to find the best way in struts of passing a collection of new values to an action class, but there doesn't seem to be an easy way of doing this ... Here's a given scenario: got a form with an arraylist. in the jsp do a logic:iterate within a html:form tag, and within the iterate tag do a html:hidden property=myArrayListElement value=0/ when I then invoke the action class, I would expect that my arraylist would then have multiple values of 0, but instead it's null. Similar sort of thing happens with string arrays ... so am I correct in saying that struts populates single form elements (like strings), but does not populate collections? At the moment I have to have a hidden String element, which when I submit the form, I have to manually populate this string with the collection values, and comma separate them. This seems a lot of work to do something so simple. Does anyone know of an easier way round this? Cheers - Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: Passing a collection (ArrayList or string array) to the Action cl ass from the jsp page ...
Just found out where the problem lies ;) The following does not work: % int i=0;% logic:iterate id=myElement name=myForm property= myArrayList html:hidden name=myElement value=%=new Integer(i).toString()%/ %i++;% /logic:iterate But the following does: % int i=0;% logic:iterate id=myElement name=myForm property=myArrayList html:hidden property=myArrayList value=%=new Integer(i).toString()%/ %i++;% /logic:iterate So the problem seems that you must specify the html element tag with the collection name, and not reference it to the iteration element. Maybe the struts documentation should be updated to clarify this situation. Regards - Chico. -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: 11 February 2002 11:31 To: Struts-User Subject: Passing a collection (ArrayList or string array) to the Action cl ass from the jsp page ... Hi, I'm trying to find the best way in struts of passing a collection of new values to an action class, but there doesn't seem to be an easy way of doing this ... Here's a given scenario: got a form with an arraylist. in the jsp do a logic:iterate within a html:form tag, and within the iterate tag do a html:hidden property=myArrayListElement value=0/ when I then invoke the action class, I would expect that my arraylist would then have multiple values of 0, but instead it's null. Similar sort of thing happens with string arrays ... so am I correct in saying that struts populates single form elements (like strings), but does not populate collections? At the moment I have to have a hidden String element, which when I submit the form, I have to manually populate this string with the collection values, and comma separate them. This seems a lot of work to do something so simple. Does anyone know of an easier way round this? Cheers - Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Java Trivia
Java does have pointers, it is just hidden from the developer! And if you are passing objects around it depends if they are mutable or not. For instance if you pass a primitive value in a method and then change its value, it's only changed inside that method call cause primitives are immutable. The same thing for Strings because they are immutable, you cannot change the contents of the string once been set. But for instance for StringBuffer it is not the case because they are mutable, the same which vectors and so on. If you want a separate copy of that instance you must use the clone method. Therefore if you pass a Vector in a method and then change it inside that method, it will have changed the instance you passed in. Chico. -Original Message- From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]] Sent: 01 February 2002 14:02 To: Struts Users Mailing List Subject: RE: Java Trivia Java doesn't have pointers! Just mudying the waters, or was it serious? If so sorry. Think of it as chucking water over someone, as opposed to passing them a cup of water. Thats pretty similar. or, um, having someone talk to you, rather than pass you a piece of paper. hmmm. J, Message History From: Galbreath, Mark [EMAIL PROTECTED] on 01/02/2002 08:48 EST Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: 'Mikkel Bruun' [EMAIL PROTECTED]; Struts (E-mail) [EMAIL PROTECTED] cc: Subject: RE: Java Trivia Obviously, the first is passed by value, but the second? We know p will reference the same object it referenced before the method invocation - the memory location it points to is the same. Because p will always point to the same memory location, is it not also passed by value? ;-) -Original Message- From: Mikkel Bruun [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 8:44 AM Ehh... primitives vs ojbects??? by value or by ref... whats the point?? -Original Message- From: Galbreath, Mark To: Struts (E-mail); J2ee (E-mail) What's the difference between int i = 3; someMethod( i); and Point p = new Point( 3, 3); someOtherMethod( p); ? Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
HTML Base Tag using SSL
We have a problem using the html:base tag when displaying a Struts JSP Page under SSL. SSL is configured on our web server (BEA WebLogic) to listen on the default port (443). When the JSP page is displayed in the browser the source HTML code shows the base tag with port 80 instead of port 443 (or blank). If we change the web server configuration so that SSL is listening on a different port (eg. 7002) then the base tag is correctly rendered with :7002. The problem may be arising because when we try to set the URL with :443 in the address the browser automatically removes the :443 and it looks like the html:base tag assumes SSL is on port 80 when it resolves it. Cheers, Chico -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
Trying to set the output from jsp page into GZIP format ...
Has anyone tried this? In the servlet you can simply do the following: PrintWriter out; boolean supportCompression = false; if (request instanceof HttpServletRequest) { Enumeration e = ((HttpServletRequest)request).getHeaders(Accept-Encoding); while (e.hasMoreElements()) { String name = (String)e.nextElement(); if (name.indexOf(gzip) != -1) { supportCompression = true; } } } if (!supportCompression) { System.out.println(-- NOT COMPRESSING); out.getWriter(); } else { System.out.println(-- COMPRESSING); if (response instanceof HttpServletResponse) { OutputStream out1 = response.getOutputStream(); out = new PrintWriter(new GZIPOutputStream(out1), false)); response.setHeader(Content-Encoding, gzip); } } But because I'm using struts, changing the JSP page into a servlet will b difficult if not impossible. Does anyone know of another way around this? cheers, Chico. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
onkeyup support on html:form ...
what i want to do is: html:form onkeyup=javascript:submit() ... /html:form does anyone know if this supported yet or is it on the todo list? chico -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: Logic:equals..
i think u have to use jsp in the value tag, like so: logic:iterate id=itr1 name=itr1 type=class logic:iterate id=itr10 name=itr100 type=class1 bean:define id=theName name=itr10 propertyname/ % String s = (String) pageContext.findAttribute(theName); % logic:equal name=itr1 property=name value=%=s% %out.println(It works);% /logic:equal /logic:iterate /logic:iterate -Original Message- From: Shane Warne [mailto:[EMAIL PROTECTED]] Sent: Friday, June 15, 2001 4:25 PM To: [EMAIL PROTECTED] Subject: Logic:equals.. Hi, I have this corky situation while using the logic:equal tag. Things is i have two iterators which get the same element from the dbase. logic:iterate id=itr1 name=itr1 type=class logic:iterate id=itr10 name=itr100 type=class1 logic:equal name=itr1 property=name value=itr10.name %out.println(It works);% /logic:equal /logic:iterate /logic:iterate This doesn't work. Is there something wrong that i'm doing. If the value is compared to a constant then the equal tag works just fine. Please let me know how i can compare a property from another variable as stated above. Thanks galore !! Shane.. __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/ -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: Accessing session attributes
u probably just need to specify 'filter' in the name attribute ... like bean:write name=filter it should try and find filter in the session, page, request, and application scopes ... in which order i can never remember ;) chico. -Original Message- From: James Howe [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 14, 2001 3:59 PM To: [EMAIL PROTECTED] Subject: Accessing session attributes This is probably a stupid question, but here it goes. I have a handful of string values that I'm storing in the session object. These values aren't associated with any bean (actually, in a sense the session object is the bean). I have a couple of places where I need to display these values in a form. I want to use the html:text tag, but I don't know what I need to specify. Let me give an example. Suppose I have a String value stored in the session by the name of filter. How would I get the filter value to display in a form text field? Thanks. -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: Logic-Iterate not finding scope of Bean
you can also have two separate action classes that use the same form, where you use the first action class when you first go into that page, then use the second when you are submitting or whatever in the form -Original Message- From: Luna, Kat [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 7:58 PM To: [EMAIL PROTECTED] Subject: Logic-Iterate not finding scope of Bean Hi all, me again with my afternoon question.. I have a UserAction class that extracts a list of Users from the database and stores them in an ArrayList. Success from this Action forwards to user.jsp which I want to display the list in table format. I have: %@ page language=java % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:html headtitle/title /head body table logic:iterate id=user name=UserAction property=userList type=com.test.User TR TDbean:write name=user property=username//TD TDbean:write name=user property=password//TD /TR /logic:iterate ..etc but this causes the UserAction to run again (essentially calling the database and building the ArrayList again). Is there a way to have this bean init() when the jsp page loads and then iterate through the ArrayList instead of calling the Action first and then displaying the page? And if so, do I need to add anything to struts-config.xml to tell the page where to find/identify the UserAction bean? Thanks, Kat Luna Web Developer, BCE Emergis [EMAIL PROTECTED] -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
displaying html errors in order
i can display errors fine, but they are displayed not in the same order as i created them ... I see this is because the ActionErrors class uses a HashMap and therefore doesn't return them in a given order (i think it sorts them according to the hashcode value). I can use the property tag in html:errors tag to display each error individually, but then it displays my error header and footer for each error displayed ... As anyone thought of a nice hack so this doesn't happen? cheers, chico -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
a struts tag within another struts tag ...
does anyone know a way of doing something like so, so that it works: logic:iterate id=listElement name=myList html:radio property=selectedListElement value=bean:write name=listElement// /logic:iterate i always get a error saying that listElement has no value in that scope ... i get around this problem using jsp, like so: logic:iterate id=listElement name=myList % String myListElement = (String) pageContext.findAttribute(listElement);% html:radio property=selectedListElement value=%=myListElement%/ /logic:iterate But I really don't want to be mixing jsp with struts ... any ideas? chico -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: a struts tag within another struts tag ...
Both suggestions don't work because the value attribute is mandatory, where you get the error: According to the TLD attribute value is mandatory for tag radio what is really needed is a way of putting a struts bean value into the value attribute of the radio tag without using jsp ... any other suggestions? chico -Original Message- From: Michael Mok [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 06, 2001 10:23 AM To: [EMAIL PROTECTED] Subject: RE: a struts tag within another struts tag ... Hi Charlesworth I think it should be more like this logic:iterate id=listElement name=myList html:radio name=listElement property=selectedListElement / /logic:iterate Regards Michael Mok -Original Message- From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 6 June 2001 16:09 To: '[EMAIL PROTECTED]' Subject: a struts tag within another struts tag ... does anyone know a way of doing something like so, so that it works: logic:iterate id=listElement name=myList html:radio property=selectedListElement value=bean:write name=listElement// /logic:iterate i always get a error saying that listElement has no value in that scope ... i get around this problem using jsp, like so: logic:iterate id=listElement name=myList % String myListElement = (String) pageContext.findAttribute(listElement);% html:radio property=selectedListElement value=%=myListElement%/ /logic:iterate But I really don't want to be mixing jsp with struts ... any ideas? chico -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: Nested logic:iterate tags
yes it is possible, like so: logic:iterate id=firstListElement name=firstList logic:iterate id=secondListElement namesecondList bean:write name=firstListElement bean:write name=secondListElement /logic:iterate /logic:iterate -Original Message- From: Marc S. Penner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 06, 2001 3:33 PM To: [EMAIL PROTECTED] Subject: Nested logic:iterate tags Is it possible to nest logic:iterate tags? I would prefer not to try to spend too much time trying to do something that isn't possible. Marc _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
setting offset of logic:iterate to a bean value ...
I'm trying to set the offset to a bean value which acts like a counter ... Basically what i want to do is: logic:iterate id=firstElement name=firstList logic:iterate id=secondElement name=secondList offset= length=1 ... /logic:iterate /logic:iterate where the offset is the current offset of firstElement ... any ideas? chico -Original Message- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 5:22 PM To: [EMAIL PROTECTED] Subject: Re: getting a specific ArrayList element The iterate tag has 'offset' and 'length' as attributes. You should be able to use both of these to retrieve a specific element. http://jakarta.apache.org/struts/struts-logic.html#iterate length - The maximum number of entries (from the underlying collection) to be iterated through on this page. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, there will be no limit on the number of iterations performed. [RT Expr] offset - The zero-relative index of the starting point at which entries from the underlying collection will be iterated through. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, zero is assumed (meaning that the collection will be iterated from the beginning. [RT Expr] David --- Charlesworth, Chico [EMAIL PROTECTED] wrote: To iterate through a java.util.ArrayList i use logic:iterate struts tag and that works fine ... but which tag do i need to use and what attribute settings do i need to access a specific ArrayList element? for example if i wanted to access the second element of my ArrayList using jsp, i would just do: %MyObject o = (MyObject) myArrayList.get(1);% Any ideas? chico -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS
RE: getting a specific ArrayList element
excellent, missed that one, cheers chico -Original Message- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 5:22 PM To: [EMAIL PROTECTED] Subject: Re: getting a specific ArrayList element The iterate tag has 'offset' and 'length' as attributes. You should be able to use both of these to retrieve a specific element. http://jakarta.apache.org/struts/struts-logic.html#iterate length - The maximum number of entries (from the underlying collection) to be iterated through on this page. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, there will be no limit on the number of iterations performed. [RT Expr] offset - The zero-relative index of the starting point at which entries from the underlying collection will be iterated through. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, zero is assumed (meaning that the collection will be iterated from the beginning. [RT Expr] David --- Charlesworth, Chico [EMAIL PROTECTED] wrote: To iterate through a java.util.ArrayList i use logic:iterate struts tag and that works fine ... but which tag do i need to use and what attribute settings do i need to access a specific ArrayList element? for example if i wanted to access the second element of my ArrayList using jsp, i would just do: %MyObject o = (MyObject) myArrayList.get(1);% Any ideas? chico -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- The content of this e-mail is confidential, may contain privileged material and is intended solely for the recipient(s) named above. If you receive this in error, please notify Software AG immediately and delete this e-mail. Software AG (UK) Limited Registered in England Wales 1310740 Registered Office: Hudson House, Hudson Way, Pride Park, Derby DE24 8HS