Re: logic:iterate
Daniel, A litle bit more info on what the columns are holding... becuase can you make them rows...then logic:iterate is easy to use... -Sam. Daniel [EMAIL PROTECTED] wrote: How can I make to print 3 coluns for line with iterate, the modulos is a ArrayList populate with myBean (atributes:modulo_nome,modulo_path) objects , the problem is divide it in 3 coluns for line.Here my source code : parameter=0 parameter=0 cheers Daniel S. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
Re: logic:iterate
%int rest=3;% logic:iterate id=listModulos name=modulos indexId=index % int line = index.intValue() % 3; % %=linha% logic:equal name=%=line% value=%=rest% Printed br /logic:equal logic:notEqual name=%=line% value=%=rest% Printed /logic:notEqual /logic:iterate How can I compare line with rest, what atributes I need to use, at the logic:notEqual I don't need bean information, I just need compare line value with rest value, if line value is zero jump for the other line. cheers Daniel S. - Original Message - From: as as [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:43 PM Subject: Re: logic:iterate Daniel, A litle bit more info on what the columns are holding... becuase can you make them rows...then logic:iterate is easy to use... -Sam. Daniel [EMAIL PROTECTED] wrote: How can I make to print 3 coluns for line with iterate, the modulos is a ArrayList populate with myBean (atributes:modulo_nome,modulo_path) objects , the problem is divide it in 3 coluns for line.Here my source code : parameter=0 parameter=0 cheers Daniel S. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate, checkboxes, and arrays of selected values...
A couple of options: 1) Use a key for the checkbox that is a combination of the two keys, combined with a character that cannot be in the keys themselves (e.g. key1::key2). They just separate them in the action, or better yet, have the form separate them. 2) Use JavasSript on the check of a row to enable/disable the two hidden fields. Disabled fields do not get transferred to the server. However, this may not be an option because it is browser-dependant. I'd probably go with the first option. -- Michael D. Norman ProbuSoft -- Custom Software Development http://www.probusoft.com/ 913-390-6951 [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 8:51 AM To: [EMAIL PROTECTED] Subject: logic:iterate, checkboxes, and arrays of selected values... Hi folks, I have a problem which I have a kludgy solution for, and have to believe there is a more elegant way of doing it... Here's the scenario. The page displays a non-editable list of records in a database, with a checkbox at the beginning of each row. The list is indeterminate length, based on selection criteria entered by the user in the previous page. The user selects n number of rows, using the check boxes. Those rows are to be deleted from the database. The trick is that the rows have a three column key. One is constant based on the user, so I need to get 2 pieces of information from each row before I can delete it. My kludge is to have the value of the checkboxes be the indexId of the logic:iterate. Each row has two hidden input fields, with the two required key values. Something like this: logic:iterate id=item name=listForm property=txnList type =Transaction indexId=counter tr td width=69 align=center input type=checkbox name=selectedTxns value=%=counter%/ /td display data ... td width=88%=item.getTotal()%/td !-- Hidden input fields so we can retrieve all the required data about the selected transaction... -- td class=sidelink width=1 input type=hidden name=orderIds value=%=item.getOrderID ()%/ /td td class=sidelink width=1 input type=hidden name=deptAreas value=%=item.getDeptArea ()%/ /td /tr /logic:iterate In the formData bean, I have three String [ ] attributes to accept the values of the checkbox and the two hidden fields. The problem is that since there is data in the hidden input fields for every row, I get every value back in the array, instead of only the data for the rows which are checked. What I have to do in the action is read the values from the String [ ] for the checkbox , and use that value as the index into the other two string arrays. Like I said, its kludgy, but it works... But, I have to believe there's a way to send back an array of beans, with only the values of the fields for those rows which are checked, but I can't find anything in books or searching the web which describes how to do this. Does anyone have a cleaner way to do this type of thing? Thanx! c'ya Mike Mike Boucher [EMAIL PROTECTED] Edgil Associates www.edgil.com Don't take life too seriously, you'll never get out of it alive! - 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, checkboxes, and arrays of selected values...
Put ALL the values in an arraylist and manipulate the arraylist values uppon return to the action. All the values are available in the same row together. The trick is getting the values from the arrayList back to the action when the form is submitted. I'm a genuine newbie and I have managed to pull this off numerous times now and it has made life much easier. I pieced together how to do this from searching the archives on this list including a previous post to someone else how to do it. If you cant find it you can send me an email off line and I'll send you some sample code. [EMAIL PROTECTED] wrote:Hi folks, I have a problem which I have a kludgy solution for, and have to believe there is a more elegant way of doing it... Here's the scenario. The page displays a non-editable list of records in a database, with a checkbox at the beginning of each row. The list is indeterminate length, based on selection criteria entered by the user in the previous page. The user selects n number of rows, using the check boxes. Those rows are to be deleted from the database. The trick is that the rows have a three column key. One is constant based on the user, so I need to get 2 pieces of information from each row before I can delete it. My kludge is to have the value of the checkboxes be the indexId of the logic:iterate. Each row has two hidden input fields, with the two required key values. Something like this: =Transaction indexId=counter [input] name=selectedTxns display data ... about the selected transaction... -- [input] ()% name=orderIds [input] ()% name=deptAreas In the formData bean, I have three String [ ] attributes to accept the values of the checkbox and the two hidden fields. The problem is that since there is data in the hidden input fields for every row, I get every value back in the array, instead of only the data for the rows which are checked. What I have to do in the action is read the values from the String [ ] for the checkbox , and use that value as the index into the other two string arrays. Like I said, its kludgy, but it works... But, I have to believe there's a way to send back an array of beans, with only the values of the fields for those rows which are checked, but I can't find anything in books or searching the web which describes how to do this. Does anyone have a cleaner way to do this type of thing? Thanx! c'ya Mike Mike Boucher [EMAIL PROTECTED] Edgil Associates www.edgil.com Don't take life too seriously, you'll never get out of it alive! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logic:iterate Exception
I forgot to add, parms is a bean declared as such: bean:define id=parms name=ParmDynaForm type=org.apache.struts.action.DynaActionForm and is used all over this JSP. I don't get it. :- -Original Message- :- From: Randy Dillon :- Sent: Friday, February 20, 2004 12:48 PM :- To: 'Struts Users Mailing List' :- Subject: Logic:iterate Exception :- :- :- I have logic that looks like this: :- :- % int n = 0; :-String strCat = ( (String[]) parms.get(cboCategory) )[n]; :-out.println(strCat + strCat + strCat); :- % :- logic:iterate id=cat indexId=i :-name=parms property=cboCategory :- logic:greaterThan value=0 name=i, /logic:greaterThan :- %strCat=( (String[]) parms.get(cboCategory) )[n];% :- bean:write name=cat / :- %=strCat% :- /logic:iterate :- :- The scriptlets are strictly for debugging purposes, because :- the bean:write... causes this exception: :- :- javax.servlet.jsp.JspException: Cannot find bean cat in scope page :- at :- org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:717) :- at :- org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:290) :- at _pages._product._orderdetail._jspService(orderdetail.jsp:48) :- :- Otherwise, everthing in the code block above works. In :- fact, the code block (minus the scriptlets) was copied from :- another page where it works without fail. Isn't the :- parms.get(...) doing the same thing as the logic:iterate :- ... combined with the bean:write ...? :-
RE: logic:iterate question
hi otto, that solution didnt work - it wouldn't recognise bar as a variable in the %= %. this solution does work for me: bean:size id=size name=articles scope=session / ... logic:iterate id=article name=articles scope=session indexId=index ... logic:equal value=%= String.valueOf(size.intValue()-1) % name=index ... /logic:equal ... /logic:iterate the value parameter must be a string, so i used the String.valueOf method. however this isnt very clean - are there better solutions? Ben -Original Message- From: Otto, Frank [mailto:[EMAIL PROTECTED] Sent: vrijdag, februari 06, 2004 10:46 To: 'Struts Users Mailing List' Subject: AW: logic:iterate question Sorry, I mean: foo.length-1 instead bar.length-1 -Ursprüngliche Nachricht- Von: Otto, Frank [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 6. Februar 2004 10:41 An: 'Struts Users Mailing List' Betreff: AW: logic:iterate question Hello Ben, you can do this in this way: logic:iterate id=foo name=bar scope=session indexId=index ... logic:equal value=%=bar.length-1% name=index ... /logic:equal /logic:iterate Regards, Frank -Ursprüngliche Nachricht- Von: Turner Benjamin [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 6. Februar 2004 09:08 An: [EMAIL PROTECTED] Betreff: logic:iterate question hello, i have a question about the logic:iterate tag. My tag iterates over an ArrayList which contains an amount of beans. However, in the last iteration i want to perform some special action. My current code looks something like this: logic:iterate id=foo name=bar scope=session indexId=index ... logic:equal value=... name=index ... /logic:equal /logic:iterate However, i have no idea what to fill in in the dots (should be something like bar.length-1), or whether this kind of construction is even supposed to work. As far as i can make up out of the docs, logic:equal is only for constant comparison. any hints on how to do this? ty, Ben - 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 question
i have a question about the logic:iterate tag. My tag iterates over an ArrayList which contains an amount of beans. However, in the last iteration i want to perform some special action. My current code looks something like this: logic:iterate id=foo name=bar scope=session indexId=index ... logic:equal value=... name=index ... /logic:equal /logic:iterate This is something that JSTL does *extremely* well: c:forEach items=foo.bar var=bar varStat=stat c:if test=stat.last do what needs to be done /c:if /c:forEach -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate question
Oops, did you mean to do this? c:forEach items=foo.bar var=bar varStat=stat c:if test=stat.last ^^^ do what needs to be done /c:if /c:forEach shouldn't that be? c:if test=${stat.last} ^^ ^ -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (cell) AIM: jmitchtx MSN: [EMAIL PROTECTED] - Original Message - From: Slattery, Tim - BLS [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, February 06, 2004 9:29 AM Subject: RE: logic:iterate question i have a question about the logic:iterate tag. My tag iterates over an ArrayList which contains an amount of beans. However, in the last iteration i want to perform some special action. My current code looks something like this: logic:iterate id=foo name=bar scope=session indexId=index ... logic:equal value=... name=index ... /logic:equal /logic:iterate This is something that JSTL does *extremely* well: c:forEach items=foo.bar var=bar varStat=stat c:if test=stat.last do what needs to be done /c:if /c:forEach -- Tim Slattery [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 question
shouldn't that be? c:if test=${stat.last} Yes, it sure should. And the first line should be: c:forEach items=${foo.bar} var=bar varStat=stat So the whole thing should look like this: c:forEach items=${foo.bar} var=bar varStat=stat c:if test=${stat.last} do what needs to be done /c:if /c:forEach -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate question
From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED] How can I iterate over a collection which depends of a request parameter? JSTL and/or Struts-EL can probably help, but I'm not quite sure what your question is. Can you give an example? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate question
Hi, Thank you for your answer.I would like to change the code shown below, to pass a request parameter to the modelList function;something like this: public Collection getModelList(String requestString){}, where requestString is a parameter of the http request.. Warmest Regards, Dragos logic:iterate id=model name=models property=modelList tr tdbean:write name=model property=name //td tdbean:write name=model property=description //td /tr /logic:iterate From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED] How can I iterate over a collection which depends of a request parameter? JSTL and/or Struts-EL can probably help, but I'm not quite sure what your question is. Can you give an example? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - 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 question
From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED] Thank you for your answer.I would like to change the code shown below, to pass a request parameter to the modelList function;something like this: public Collection getModelList(String requestString){}, where requestString is a parameter of the http request.. logic:iterate id=model name=models property=modelList tr tdbean:write name=model property=name //td tdbean:write name=model property=description //td /tr /logic:iterate I don't think you can pass parameters in JSTL, at least not yet. But you could, in your action, call getModelList passing the String you got from the request, and then when you forward to the JSP, iterate over that Collection. If getModelList returned a Map, or you made a getAllModelLists method that returns a Map, you might have this: c:forEach items=${myBean.allModelLists[theRequestParam]} item=${model} c:out value=${model.name}/ /c:forEach That depends on how big they are, and whether they change for each user. If you models are fixed and change infrequently, you might be able to put a big Map in Application scope and use it across the entire webapp. Out of curiosity, what class is getModelList from? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate question
You should be able to use BeanUtils' mapped property access for this, right? c:set var=modelListProp value=modelList(${param.paramName})/ jsp:useBean id=modelListProp type=java.lang.String/ bean:define id=modelList name=bean property=%= modelListProp %/ Which should give you a bean called modelList that holds your collection. This assumes there's a bean called bean whose class implements the getModelList method. Quoting Wendy Smoak [EMAIL PROTECTED]: From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED] Thank you for your answer.I would like to change the code shown below, to pass a request parameter to the modelList function;something like this: public Collection getModelList(String requestString){}, where requestString is a parameter of the http request.. logic:iterate id=model name=models property=modelList tr tdbean:write name=model property=name //td tdbean:write name=model property=description //td /tr /logic:iterate I don't think you can pass parameters in JSTL, at least not yet. But you could, in your action, call getModelList passing the String you got from the request, and then when you forward to the JSP, iterate over that Collection. If getModelList returned a Map, or you made a getAllModelLists method that returns a Map, you might have this: c:forEach items=${myBean.allModelLists[theRequestParam]} item=${model} c:out value=${model.name}/ /c:forEach That depends on how big they are, and whether they change for each user. If you models are fixed and change infrequently, you might be able to put a big Map in Application scope and use it across the entire webapp. Out of curiosity, what class is getModelList from? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate question
Forgot the obligatory, but you should really do this in an action. There's no reason to clog your JSP with this kind of stuff. Grab the collection in an action, set it as a request attribute, forward to the JSP, and... Quoting Kris Schneider [EMAIL PROTECTED]: You should be able to use BeanUtils' mapped property access for this, right? c:set var=modelListProp value=modelList(${param.paramName})/ jsp:useBean id=modelListProp type=java.lang.String/ bean:define id=modelList name=bean property=%= modelListProp %/ Which should give you a bean called modelList that holds your collection. This assumes there's a bean called bean whose class implements the getModelList method. Quoting Wendy Smoak [EMAIL PROTECTED]: From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED] Thank you for your answer.I would like to change the code shown below, to pass a request parameter to the modelList function;something like this: public Collection getModelList(String requestString){}, where requestString is a parameter of the http request.. logic:iterate id=model name=models property=modelList tr tdbean:write name=model property=name //td tdbean:write name=model property=description //td /tr /logic:iterate I don't think you can pass parameters in JSTL, at least not yet. But you could, in your action, call getModelList passing the String you got from the request, and then when you forward to the JSP, iterate over that Collection. If getModelList returned a Map, or you made a getAllModelLists method that returns a Map, you might have this: c:forEach items=${myBean.allModelLists[theRequestParam]} item=${model} c:out value=${model.name}/ /c:forEach That depends on how big they are, and whether they change for each user. If you models are fixed and change infrequently, you might be able to put a big Map in Application scope and use it across the entire webapp. Out of curiosity, what class is getModelList from? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate question
I don't think you can pass parameters in JSTL, at least not yet. But you could, in your action, call getModelList passing the String you got from the request, and then when you forward to the JSP, iterate over that Collection. I am not sure what you meant, Wendy, but, in case you meant that you cannot use parameters, then check out: http://jakarta.apache.org/struts/faqs/indexedpropers.html . If this is helpful, I use this with a BeanMap I whipped up: public final class BeanMap implements Map { private Map map; private BeanMap() { } public static Map getInstance(Map map) { BeanMap bean = new BeanMap(); bean.setMap(map); return bean; } public void setMap(Map map) { this.map = map; log.info(this.map); } public void setValue(Object key, Object value) { map.put(key,value); } public Object getValue(Object key) { return map.get(key); } // Forwarding, composition, methods public void clear() { map.clear(); } public booleancontainsKey(Object key) { return map.containsKey(key);} public booleancontainsValue(Object value) { return map.containsValue(value); } public SetentrySet(){ return map.entrySet(); } public booleanequals(Object object) { return map.equals(object); } public Object get(Object key) { return map.get(key); } public inthashCode(){ return map.hashCode(); } public booleanisEmpty() { return map.isEmpty(); } public SetkeySet() { return map.keySet(); } public Object put(Object key, Object value) { return map.put(key,value); } public void putAll(Map map) { map.putAll(map); } public Object remove(Object key){ return map.remove(key); } public intsize(){ return map.size(); } public Collection values() { return map.values(); } public String toString(){ return map.toString(); } }///;-) Bye 'd bye, Michael
Re: logic:iterate ... logic:equal question?
you can do as following. countryCollection is an ArryList with object of struts' LabelValueBean. The value is the country code and label is the country name for example. Once the user changes the country selection, it will submit the change to server so that the action can generate the city list based on the selected county. Once it's done, forward to itself. The list of city will be populated accordingly. If you want use javascript, then it's a different story. Hope this can help! html:select property=selectedCountry html:options collection=countryCollection property=value labelProperty=label onchange=submit() / /html:select html:select property=selectedCity html:options collection=cityCollection property=value labelProperty=label / /html:select Jiin-Her Lu (816) 926-2145 [EMAIL PROTECTED] 02/02/04 09:49AM Apologies for this newbie question... I have 2 selections: Country and City I have 2 collections in session (CityList contains a reference to Country) I don't want the user to select a City before selecting a Country and I want to display a list of Cities that relate to the selected Country... Can anyone please help with this code: ... tr tdCountry/td td html:select property=country onchange=document.forms['myForm'].city.value=''; document.forms['myForm'].submit(); html:option value=Select a country.../html:option html:options collection=CountryList property=country labelProperty=description / /html:select font color=redhtml:errors property=country //font /td /tr tr tdCity/td td html:select property=city html:option value=Select a city.../html:option logic:iterate id=City name=CityList property=list type=City --- -- logic:equal name=City property=country value= !!! This is where I'm stumped. How do I get the comparison to work between 2 beans? --- -- html:option name=City property=city labelProperty=description / /logic:equals /logic:iterate /html:select font color=redhtml:errors property=city //font /td /tr ... Any help much appreciated! Derek - 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 ... logic:equal question? SELECTED ATTRIBUTE
How does one add selected attribute if I want one the option to have the SELECTED attribute --- Jiin-Her Lu [EMAIL PROTECTED] wrote: you can do as following. countryCollection is an ArryList with object of struts' LabelValueBean. The value is the country code and label is the country name for example. Once the user changes the country selection, it will submit the change to server so that the action can generate the city list based on the selected county. Once it's done, forward to itself. The list of city will be populated accordingly. If you want use javascript, then it's a different story. Hope this can help! html:select property=selectedCountry html:options collection=countryCollection property=value labelProperty=label onchange=submit() / /html:select html:select property=selectedCity html:options collection=cityCollection property=value labelProperty=label / /html:select Jiin-Her Lu (816) 926-2145 [EMAIL PROTECTED] 02/02/04 09:49AM Apologies for this newbie question... I have 2 selections: Country and City I have 2 collections in session (CityList contains a reference to Country) I don't want the user to select a City before selecting a Country and I want to display a list of Cities that relate to the selected Country... Can anyone please help with this code: ... tr tdCountry/td td html:select property=country onchange=document.forms['myForm'].city.value=''; document.forms['myForm'].submit(); html:option value=Select a country.../html:option html:options collection=CountryList property=country labelProperty=description / /html:select font color=redhtml:errors property=country //font /td /tr tr tdCity/td td html:select property=city html:option value=Select a city.../html:option logic:iterate id=City name=CityList property=list type=City --- -- logic:equal name=City property=country value= !!! This is where I'm stumped. How do I get the comparison to work between 2 beans? --- -- html:option name=City property=city labelProperty=description / /logic:equals /logic:iterate /html:select font color=redhtml:errors property=city //font /td /tr ... Any help much appreciated! Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate ... logic:equal question? SELECTED ATTRIBUTE
Struts does this for you if the value of the SELECT parameter equals the OPTION... Derek -Original Message- From: Jino Morgan [mailto:[EMAIL PROTECTED] Sent: 02 February 2004 17:48 To: Struts Users Mailing List Subject: Re: logic:iterate ... logic:equal question? SELECTED ATTRIBUTE How does one add selected attribute if I want one the option to have the SELECTED attribute --- Jiin-Her Lu [EMAIL PROTECTED] wrote: you can do as following. countryCollection is an ArryList with object of struts' LabelValueBean. The value is the country code and label is the country name for example. Once the user changes the country selection, it will submit the change to server so that the action can generate the city list based on the selected county. Once it's done, forward to itself. The list of city will be populated accordingly. If you want use javascript, then it's a different story. Hope this can help! html:select property=selectedCountry html:options collection=countryCollection property=value labelProperty=label onchange=submit() / /html:select html:select property=selectedCity html:options collection=cityCollection property=value labelProperty=label / /html:select Jiin-Her Lu (816) 926-2145 [EMAIL PROTECTED] 02/02/04 09:49AM Apologies for this newbie question... I have 2 selections: Country and City I have 2 collections in session (CityList contains a reference to Country) I don't want the user to select a City before selecting a Country and I want to display a list of Cities that relate to the selected Country... Can anyone please help with this code: ... tr tdCountry/td td html:select property=country onchange=document.forms['myForm'].city.value=''; document.forms['myForm'].submit(); html:option value=Select a country.../html:option html:options collection=CountryList property=country labelProperty=description / /html:select font color=redhtml:errors property=country //font /td /tr tr tdCity/td td html:select property=city html:option value=Select a city.../html:option logic:iterate id=City name=CityList property=list type=City - -- -- logic:equal name=City property=country value= !!! This is where I'm stumped. How do I get the comparison to work between 2 beans? - -- -- html:option name=City property=city labelProperty=description / /logic:equals /logic:iterate /html:select font color=redhtml:errors property=city //font /td /tr ... Any help much appreciated! Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - 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 ... logic:equal question? SELECTED ATTRIBUTE
In you ActionForm java class, you have to define the selectedCountry instance variable. For example public MyForm extends ActionForm { private String [] selectedCountry = {}; // if the option is multiple selection (check box or multiple selection listbox) // private String selectCountry;// if the option is single selection (radio button or dropdown box) // generate getter and setter method based on the above variable) } When Struts populates the data, it checks the selectedCountry array in your form. If the country is found in your ActionForm, Struts automatically adds selected to that item (country). You don't have to do anything as long as your ActionForm class defined correctly. I have done for radio button, checkbox, dropdown box, single and multiple listbox. They work well! Jiin-Her Lu (816) 926-2145 [EMAIL PROTECTED] 02/02/04 11:47AM How does one add selected attribute if I want one the option to have the SELECTED attribute --- Jiin-Her Lu [EMAIL PROTECTED] wrote: you can do as following. countryCollection is an ArryList with object of struts' LabelValueBean. The value is the country code and label is the country name for example. Once the user changes the country selection, it will submit the change to server so that the action can generate the city list based on the selected county. Once it's done, forward to itself. The list of city will be populated accordingly. If you want use javascript, then it's a different story. Hope this can help! html:select property=selectedCountry html:options collection=countryCollection property=value labelProperty=label onchange=submit() / /html:select html:select property=selectedCity html:options collection=cityCollection property=value labelProperty=label / /html:select Jiin-Her Lu (816) 926-2145 [EMAIL PROTECTED] 02/02/04 09:49AM Apologies for this newbie question... I have 2 selections: Country and City I have 2 collections in session (CityList contains a reference to Country) I don't want the user to select a City before selecting a Country and I want to display a list of Cities that relate to the selected Country... Can anyone please help with this code: ... tr tdCountry/td td html:select property=country onchange=document.forms['myForm'].city.value=''; document.forms['myForm'].submit(); html:option value=Select a country.../html:option html:options collection=CountryList property=country labelProperty=description / /html:select font color=redhtml:errors property=country //font /td /tr tr tdCity/td td html:select property=city html:option value=Select a city.../html:option logic:iterate id=City name=CityList property=list type=City --- -- logic:equal name=City property=country value= !!! This is where I'm stumped. How do I get the comparison to work between 2 beans? --- -- html:option name=City property=city labelProperty=description / /logic:equals /logic:iterate /html:select font color=redhtml:errors property=city //font /td /tr ... Any help much appreciated! Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - 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 and logic:equalquestion
Solution 1 : bean:define id=myObject name=element property=value/ logic:equal name=myObject property=status value=trueActive/logic:equal ... Solution 2 : logic:equal name=element property=value.status value=trueActive/logic:equal ... Nico. Hi all, I need to use the logic:equal inside a logic iterate..and I am Having problems.. My case is that I hae in an ActionForm an HashMap property which contains Pairs of String, MyObject. My object has a Boolean property called status What I want to do is to loop thru all the objects in my hashmap and, if the property status has a value of true I want to display button A, while if it is false I want to display button B. For testing purposes I am now displaying some text... I tried with following loop, but seems that is not working properly // Loop thru all the objects contained in the hashmap logic:iterate id=element name=batchTaskForm property=tasks tr class=workscreen td align=right class=workscreen // Here I got myObject , and its property 'type' bean:write name=element property=value.type/ /td td align=left class=workscreen // Now I should reuse MyObject herebut below code raises // exception (obviously) logic:equal name=element property=status value=trueActive/logic:equal logic:equal name=element property=status value=falseInactive/logic:equal /td /tr /logic:iterate I believe I should go for a bean:define tag but I m not sure how to use it Anyone can help? Thanx in advance and regards marco - 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 and html:text problem
snip but I don't know how large this Vector will be /snip One trick is to submit the size back in a hidden field. In the forms reset() method, you can use request.getParameter() (unless its a multipart form!) to get the size and initialise the vector before the form is populated from the request. Id suggest however that since you have two two fields per row you may as well use nested form beans for each row rather than vectors for each column. (Also makes it much more convienient to add a third++ column later on if you need to.) There is a good tutorial on this at the keyboard monkey site: http://www.keyboardmonkey.com/next/index.jsp hth Andrew -Original Message- From: Anna Yates [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 January 2004 12:21 To: [EMAIL PROTECTED] Subject: Logic:iterate and html:text problem I have multiple text boxes that I display on my page. Basically, I must show n rows (2 text boxes per row). I have no problem displaying them, but I am unclear on how to get the data back in a concise manner. To display, I use logic:iterate (see below): logic:iterate name=custAcctForm id=multiple property=multipleIds bean:write property=profileName name=multipleIds html:text property=userName name=multipleIds html:text property=password name=multipleIds In my form I have a Vector defined, private Vector multipleIds; The Vector holds a collection of my class, MultipleIdData which has 3 member variables: profileName, userName, and password. When I use the code above, it displays correctly, but the entered data goes nowhere. I have tried to define the id property to the multipleIds value, but it gives me an error that no collection was found. I was thinking I could index the values, but am unclear if this is the road I should take. I have seen that if I initialize the Vector to some initial capacity, this will work, but I don't know how large this Vector will be. Does anyone have any suggestions. Thanks. _ Check out the coupons and bargains on MSN Offers! http://shopping.msn.com/softcontent/softcontent.aspx?scmId=1418 - 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 and html:text problem
Well, a) I have not used logic:iterate for these purpose, hence won't be able to help you out much there. I use the JSTL tags and try to keep away from the struts tag as much as possible. b) I would use ArrayList instead of Vectors. What I would do if I were you would be something like this: table c:forEach var=someVarName items=${yourForm.myVector} tr td c:out value=${someVarName.profileName}/ /td td html:text indexed=true name=someVarName property=userName/ /td html:text indexed=true name=someVarName property=password/ /td /tr /c:foreach table I have added the table just for clarity. You may want to put a check for empty or null collection doing either c:when test='${empty yourForm.myVector}' In case you already have this bean Or having another method like getSize() or something like that. Assuming that you have set and set methods on each one of the above three parameters in your MultipleIdData bean. Try this and see if the vales get populated in the Collection when you get it in your Action from the form. This may contain some errors but should get you started :) -Original Message- From: Anna Yates [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 11:21 PM To: [EMAIL PROTECTED] Subject: Logic:iterate and html:text problem I have multiple text boxes that I display on my page. Basically, I must show n rows (2 text boxes per row). I have no problem displaying them, but I am unclear on how to get the data back in a concise manner. To display, I use logic:iterate (see below): logic:iterate name=custAcctForm id=multiple property=multipleIds bean:write property=profileName name=multipleIds html:text property=userName name=multipleIds html:text property=password name=multipleIds In my form I have a Vector defined, private Vector multipleIds; The Vector holds a collection of my class, MultipleIdData which has 3 member variables: profileName, userName, and password. When I use the code above, it displays correctly, but the entered data goes nowhere. I have tried to define the id property to the multipleIds value, but it gives me an error that no collection was found. I was thinking I could index the values, but am unclear if this is the road I should take. I have seen that if I initialize the Vector to some initial capacity, this will work, but I don't know how large this Vector will be. Does anyone have any suggestions. Thanks. _ Check out the coupons and bargains on MSN Offers! http://shopping.msn.com/softcontent/softcontent.aspx?scmId=1418 - 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 question
if you know its only one item, why don't change the action... insteat of: request.setAttribute(testers,testerInfo); try request.setAttribute(testers,testerInfo[0]); hernux - Original Message - From: struts [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, December 19, 2003 6:51 AM Subject: logic:iterate question I have logic:iterate id=testers name=testerInfo . /logic:iterate I only have one item in the testerInfo collection. Why can't i do bean:define id=testers name=testerInfo/ Or how can i put it to the first item? Thanks ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate inside a logic:iterate ??
logic:iterate id=document name=formName property=documents logic:iterate id=lv name=document property=labelValueBeans bean:write name=lv property=label/ bean:write name=lv property=value/ /logic:iterate /logic:iterate You should probably use JSTL for this. c:forEach var=document items=${formName.documents} c:forEach var=lv items=${document.lableValueBeans} c:out value=${lv.label}/ c:out value=${lv.value}/ /c:forEach /c:forEach -Original Message- From: gentyjp [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 12:16 PM To: [EMAIL PROTECTED] Subject: logic:iterate inside a logic:iterate ?? Hi I'am a Struts newbie, sorry if it is a classic question. My question is about logic:iterate I have a vector of documents. In my application a document is a vector of LabelValueBean. I wish to write both the label and the value. I wish to write all my documents so I iterate through my vector of documents. But after that how can I iterate through my vector of LabelValueBean ??? Basically here's what I want to do : for_each_document { for_each_LabelValueBean_in_the_current_document { write LabelValueBean.Label; write LabelValueBean.Value; } } thanks for you help Genty Jean-Paul - 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 inside a logic:iterate ??
try something similar to this (of course all the Java code to construct the lists should be in (or called by) a Struts Action class, so focus on the use of the logic:iterate tag) --8loop.jsp-- %@ page import=java.util.* % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % %! public class Person { String fName = null; LinkedList fEmailList = new LinkedList(); public String getName() { return fName; } public LinkedList getEmailList() { return fEmailList; } } % % LinkedList vPersonList = new LinkedList(); Person vPerson = new Person(); vPerson.fName = Jan Vervecken; vPerson.fEmailList.add([EMAIL PROTECTED]); vPerson.fEmailList.add([EMAIL PROTECTED]); vPersonList.add(vPerson); vPerson = new Person(); vPerson.fName = Genty Jean-Paul; vPerson.fEmailList.add([EMAIL PROTECTED]); vPerson.fEmailList.add([EMAIL PROTECTED]); vPerson.fEmailList.add([EMAIL PROTECTED]); vPersonList.add(vPerson); request.setAttribute(personList, vPersonList); % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html locale=true HEAD TITLEloop/TITLE /HEAD BODY H3loop/H3 UL logic:iterate id=person name=personList LI bean:write name=person property=name/ UL logic:iterate id=email name=person property=emailList LI bean:write name=email/ /LI /logic:iterate /UL /LI /logic:iterate /UL /BODY /html:html --8-- success -Jan *** REPLY SEPARATOR *** On 12/18/2003 at 6:16 PM gentyjp wrote: Hi I'am a Struts newbie, sorry if it is a classic question. My question is about logic:iterate I have a vector of documents. In my application a document is a vector of LabelValueBean. I wish to write both the label and the value. I wish to write all my documents so I iterate through my vector of documents. But after that how can I iterate through my vector of LabelValueBean ??? Basically here's what I want to do : for_each_document { for_each_LabelValueBean_in_the_current_document { write LabelValueBean.Label; write LabelValueBean.Value; } } thanks for you help Genty Jean-Paul - 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 and Map
In the scriptlet expression, there is no property key on the object aciterator; use aciterator.getKey() instead. However, you can't mix string literals and runtime expressions like that in a JSP tag attribute. If you use a runtime attribute, it must be the exclusive content of the attribute, so you need to do something like a bean:define earlier where you define a bean whose content is the assembled value, and then use the newly defined bean in a scriptlet in the attribute. (i.e. bean:define id=foo appCourse(%=aciterator.key%).level/bean:define and then later %= foo %) Joe On Dec 2, 2003, at 3:34 PM, [EMAIL PROTECTED] wrote: Hi All i am doing the following logic:iterate id=aciterator name=rsiappForm property=appCoursesMap tr td width=15%div align=center html:radio property=appCourse(%=aciterator.key%).level value=regular / /div/td td width=15%div align=center html:radio property=appCourse(%=aciterator.key%).level value=honors / /logic:iterate where appCoursesMap is a Map initialized as a HashMap. I am getting an error as follows Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] /usr/jakarta-tomcat-4.1.24/work/Standalone/localhost/apps_rsi/forms/ rsi_app_step3_form_jsp.java:271: cannot resolve symbol [javac] symbol : variable key [javac] location: class java.lang.Object [javac] out.print(aciterator.key); [javac] ^ [javac] 1 error at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorH andler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.j ava:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) I am thinkng the logic:iterate tag should take the Map as Map.Entry and hence i have used the property=appCourse(%=aciterator.key%).level. I have getter and setter methods for appCourse too that take parameter as key and Key and Value respectively that set this Map. Please let me know --Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com We want beef in dessert if we can get it there. -- Betty Hogan, Director of New Product Development, National Cattlemen's Beef Association smime.p7s Description: S/MIME cryptographic signature
Re: logic:iterate and Map
Hi Joe underneath should i have it as In the scriptlet expression, there is no property key on the object aciterator; use aciterator.getKey() instead. However, you can't mix string literals and runtime expressions like that in a JSP tag attribute. If you use a runtime attribute, it must be the exclusive content of the attribute, so you need to do something like a bean:define earlier where you define a bean whose content is the assembled value, and then use the newly defined bean in a scriptlet in the attribute. (i.e. bean:define id=foo here should be aciterator.key or aciterator.getKey()? appCourse(%=aciterator.key%).level/bean:define and then later %= foo %) Joe On Dec 2, 2003, at 3:34 PM, [EMAIL PROTECTED] wrote: Hi All i am doing the following logic:iterate id=aciterator name=rsiappForm property=appCoursesMap tr td width=15%div align=center html:radio property=appCourse(%=aciterator.key%).level value=regular / /div/td td width=15%div align=center html:radio property=appCourse(%=aciterator.key%).level value=honors / /logic:iterate where appCoursesMap is a Map initialized as a HashMap. I am getting an error as follows Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] /usr/jakarta-tomcat-4.1.24/work/Standalone/localhost/apps_rsi/forms/ rsi_app_step3_form_jsp.java:271: cannot resolve symbol [javac] symbol : variable key [javac] location: class java.lang.Object [javac] out.print(aciterator.key); [javac] ^ [javac] 1 error at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorH andler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.j ava:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) I am thinkng the logic:iterate tag should take the Map as Map.Entry and hence i have used the property=appCourse(%=aciterator.key%).level. I have getter and setter methods for appCourse too that take parameter as key and Key and Value respectively that set this Map. Please let me know --Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com We want beef in dessert if we can get it there. -- Betty Hogan, Director of New Product Development, National Cattlemen's Beef Association - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate help
Hi Guys The reason i am using the logic:iterate is not to populate the select box but to create the select box for the number times the length of the testScoresVector and store the option selected in the select box in each of the testScoresVector element. --Mohan Hi All I have a Vector called as testScoresVector (Vector of testScores Objects) stored in the session I am trying this logic:iterate id=tsv name=testScoresVector html:select property=tsv.testName html:option value=SAT-1SAT-1/html:option html:option value=SAT-2SAT-2/html:option : : /html:select /logic:iterate The idea is to add the selected value into the TestScores Object for each object in the Vector. This gives an error saying :No getter method available for property tsv.testName for bean under name org.apache.struts.taglib.html.BEAN I think the tsv holds a TestScoresVector object for each iteration. Am i right or not. Please let me know Thank you --Mohan - 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 help
Hi All I have tried this logic:iterate id=tsv collection=testScoresVector testScoresVector is a vector stored as a session Attribute as request.getSession().setAttribute(testScoresVector, testScoresVector) Please let me know what the problem is --Mohan Hi Guys The reason i am using the logic:iterate is not to populate the select box but to create the select box for the number times the length of the testScoresVector and store the option selected in the select box in each of the testScoresVector element. --Mohan Hi All I have a Vector called as testScoresVector (Vector of testScores Objects) stored in the session I am trying this logic:iterate id=tsv name=testScoresVector html:select property=tsv.testName html:option value=SAT-1SAT-1/html:option html:option value=SAT-2SAT-2/html:option : : /html:select /logic:iterate The idea is to add the selected value into the TestScores Object for each object in the Vector. This gives an error saying :No getter method available for property tsv.testName for bean under name org.apache.struts.taglib.html.BEAN I think the tsv holds a TestScoresVector object for each iteration. Am i right or not. Please let me know Thank you --Mohan - 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 help
I recommend you drop the Struts logic tags and switch to JSTL combined with the Struts-el tags. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization and locale-sensitive formatting tags, and SQL tags. It also introduces a new expression language to simplify page development... http://java.sun.com/products/jsp/jstl/ Core JSTL: Mastering the JSP Standard Tag Library by David M. Geary http://www.amazon.com/exec/obidos/tg/detail/-/0131001531/qid=1069734758/sr=1-2/ref=sr_1_2/002-2465270-5458431?v=glances=books By combing Struts-el with JSTL a select tag with options can be written as: html-el:select property=moduleTypeCode c:forEach items='${applicationScope[constants.moduleTypeCodeTypeLabelMapKey]}' var='mapItem' html-el:option value=${mapItem.key}c:out value='${mapItem.value}'//html-el:option /c:forEach /html-el:select The map of module types is loaded from a data store by a Struts plug-in at system start up. Mike --- [EMAIL PROTECTED] wrote: Hi All I have a Vector called as testScoresVector (Vector of testScores Objects) stored in the session I am trying this logic:iterate id=tsv name=testScoresVector html:select property=tsv.testName html:option value=SAT-1SAT-1/html:option html:option value=SAT-2SAT-2/html:option : : /html:select /logic:iterate The idea is to add the selected value into the TestScores Object for each object in the Vector. This gives an error saying :No getter method available for property tsv.testName for bean under name org.apache.struts.taglib.html.BEAN I think the tsv holds a TestScoresVector object for each iteration. Am i right or not. Please let me know Thank you --Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate help
hi MOhan Error is coming coz your syntax is not upto the mark. Try with the following logic:iterate id=tsv name=testScoresVector html:select property=testName html:collection name=tsv labelproperty=any property name of the Vector/ /html:select /logic:iterate Cheers gary - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 3:24 AM Subject: logic:iterate help Hi All I have a Vector called as testScoresVector (Vector of testScores Objects) stored in the session I am trying this logic:iterate id=tsv name=testScoresVector html:select property=tsv.testName html:option value=SAT-1SAT-1/html:option html:option value=SAT-2SAT-2/html:option : : /html:select /logic:iterate The idea is to add the selected value into the TestScores Object for each object in the Vector. This gives an error saying :No getter method available for property tsv.testName for bean under name org.apache.struts.taglib.html.BEAN I think the tsv holds a TestScoresVector object for each iteration. Am i right or not. Please let me know Thank you --Mohan - 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 help
try this logic:iterate id=tsv name=testScoresVector html:select property=testName html:options collection=tsv property=stateId labelProperty=stateName/ : : /html:select /logic:iterate cheers Gurpreet DHanoa - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 3:24 AM Subject: logic:iterate help Hi All I have a Vector called as testScoresVector (Vector of testScores Objects) stored in the session I am trying this logic:iterate id=tsv name=testScoresVector html:select property=tsv.testName html:option value=SAT-1SAT-1/html:option html:option value=SAT-2SAT-2/html:option : : /html:select /logic:iterate The idea is to add the selected value into the TestScores Object for each object in the Vector. This gives an error saying :No getter method available for property tsv.testName for bean under name org.apache.struts.taglib.html.BEAN I think the tsv holds a TestScoresVector object for each iteration. Am i right or not. Please let me know Thank you --Mohan - 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 within a logic:iterate?
On Oct 2, 2003, Smith, Johnathan M. [EMAIL PROTECTED] wrote: |In Struts 1.0.2? | |Can I have a logic:iterate within a logic:iterate loop?? Yup. |If so can someone please send me a sample logic:iterate id=item name=bfData type=...web.dto.BfFullEntryData indexId=index logic:iterate id=obj name=item property=wireData type=...web.dto.BfWireData stuff here /logic:iterate /logic:iterate HTH... /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate problem
Thats not. You use something like bean:message or an other tag that uses message resources. But the Struts-Framework can't find the resourceBundle.. Manfred Gregory F. March wrote: Make sure your getters and setters conform to the Java naming conventions - I got burned by something similar and that was the root cause... HTH... /greg On Sep 26, 2003, MaFai [EMAIL PROTECTED] wrote: |Hello, struts-user, | |[code] |logic:iterate id=customer name=customers type=STB.Customer |bean:write name=customer property=testb/ |bean:write name=customer property=pps/ |/logic:iterate |[/code] | |customers is set by request.setAttribute | |pps is string value. |testb is a int value | |If remove the testb ,it run smoonthly. |If change testb to boolean,it also run smoothly. |Otherwise | |It always throw the exception | |org.apache.jasper.JasperException: Cannot find message resources under key or | g.apache.struts.action.MESSAGE | |Why?I'm stun at these 2 days. | | | | | |Best regards. | |MaFai |[EMAIL PROTECTED] |2003-09-26 | | | |- |To unsubscribe, e-mail: [EMAIL PROTECTED] |For additional commands, e-mail: [EMAIL PROTECTED] -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. 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 unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate problem
Make sure your getters and setters conform to the Java naming conventions - I got burned by something similar and that was the root cause... HTH... /greg On Sep 26, 2003, MaFai [EMAIL PROTECTED] wrote: |Hello, struts-user, | |[code] |logic:iterate id=customer name=customers type=STB.Customer |bean:write name=customer property=testb/ |bean:write name=customer property=pps/ |/logic:iterate |[/code] | |customers is set by request.setAttribute | |pps is string value. |testb is a int value | |If remove the testb ,it run smoonthly. |If change testb to boolean,it also run smoothly. |Otherwise | |It always throw the exception | |org.apache.jasper.JasperException: Cannot find message resources under key or | g.apache.struts.action.MESSAGE | |Why?I'm stun at these 2 days. | | | | | |Best regards. | |MaFai |[EMAIL PROTECTED] |2003-09-26 | | | |- |To unsubscribe, e-mail: [EMAIL PROTECTED] |For additional commands, e-mail: [EMAIL PROTECTED] -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate understanding
use the propery ...in your case it is fields Prashanth.S [EMAIL PROTECTED] 09/26/03 09:04 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:logic:iterate understanding Hi all, i found this tag while going through one of jsps but i couldnt understand what this denotes logic:iterate id=oneInput property=fields I dont find any name attributeThan how can a property attribute can be used.. Thanks Prashanth - Do you Yahoo!? The New Yahoo! Shopping - with improved product search = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = =
Re: logic:iterate understanding
Hi julie, Thanks for the reply but i wanted to know what does this property=fields denote as there is no name attribute used in it??? logic:iterate id=oneInput property=fields Thanks Prashanth [EMAIL PROTECTED] wrote: use the propery ...in your case it is fields Prashanth.S 09/26/03 09:04 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject: understanding Hi all, i found this tag while going through one of jsps but i couldnt understand what this denotes I dont find any name attributeThan how can a property attribute can be used.. Thanks Prashanth - Do you Yahoo!? The New Yahoo! Shopping - with improved product search = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = - Do you Yahoo!? The New Yahoo! Shopping - with improved product search
Re: logic:iterate understanding
If you do not specify a name attribute, then an assumption is made that the specified property is an attribute in the form that is associated with the mapping. If you have a mapping (SampleAction) that uses a form (SampleForm), then the example you gave below assumes that the SampleForm object has an attribute called fields that is a collection. Nick Prashanth.S [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] o.com cc: Subject: Re: logic:iterate understanding 09/26/2003 09:41 AM Please respond to Struts Users Mailing List Hi julie, Thanks for the reply but i wanted to know what does this property=fields denote as there is no name attribute used in it??? logic:iterate id=oneInput property=fields Thanks Prashanth [EMAIL PROTECTED] wrote: use the propery ...in your case it is fields Prashanth.S 09/26/03 09:04 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject: understanding Hi all, i found this tag while going through one of jsps but i couldnt understand what this denotes I dont find any name attributeThan how can a property attribute can be used.. Thanks Prashanth - Do you Yahoo!? The New Yahoo! Shopping - with improved product search = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = - Do you Yahoo!? The New Yahoo! Shopping - with improved product search - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate understanding
Hi Nick, Great!!Thanks for ur replyI got ur point Thanks Prashanth Nicholas L Mohler [EMAIL PROTECTED] wrote: If you do not specify a name attribute, then an assumption is made that the specified property is an attribute in the form that is associated with the mapping. If you have a mapping (SampleAction) that uses a form (SampleForm), then the example you gave below assumes that the SampleForm object has an attribute called fields that is a collection. Nick Prashanth.S o.com cc: Subject: Re: understanding 09/26/2003 09:41 AM Please respond to Struts Users Mailing List Hi julie, Thanks for the reply but i wanted to know what does this property=fields denote as there is no name attribute used in it??? Thanks Prashanth [EMAIL PROTECTED] wrote: use the propery ...in your case it is fields Prashanth.S 09/26/03 09:04 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject: understanding Hi all, i found this tag while going through one of jsps but i couldnt understand what this denotes I dont find any name attributeThan how can a property attribute can be used.. Thanks Prashanth - Do you Yahoo!? The New Yahoo! Shopping - with improved product search = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = - Do you Yahoo!? The New Yahoo! Shopping - with improved product search - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The New Yahoo! Shopping - with improved product search
Re: logic:iterate problem
uhh.. Never mind. Figured it out. Told you all it would be something stupid. Forgot to add the %@ taglib uri=/tags/struts-bean prefix=bean%... Sorry to waste bandwidth. -- Bryce Fischer [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate problem
To partially answer my own question, I changed this: table trthCenter/ththTitle/ththTotal/th/tr logic:iterate id=centerItem name=browseCenters type=com.berzerkersoft.bisweb.db.ejb.value.CenterBrowseValue tr tdbean:write name=centerItem property=center//td /tr /logic:iterate /table to read: table trthCenter/ththTitle/ththTotal/th/tr logic:iterate id=centerItem name=browseCenters type=com.berzerkersoft.bisweb.db.ejb.value.CenterBrowseValue tr tdElement Value: bean:write name=centerItem property=center//td /tr /logic:iterate /table and I get the exact number of Element Value: outputs, but no output from the bean tag So something must be wrong with the bean tag or the way I have my id declared... -- Bryce Fischer [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate with changing row colors
Christian, Not exactly struts, but you can do this using the JSTL taglibs with the varStatus attribute, like: c:forEach items=${sessionScope.advertMultiEditForm.idsAsList} var=thisid varStatus=stat c:set var=bg value=white / c:if test=${stat.index % 2 == 0} c:set var=bg value=blue / tr bgcolor=c:out value=${bg} / td ... /td /tr /c:if /c:forEach or check out the display tag library at: http://edhill.its.uiowa.edu/display/ which is great and makes this very easy. Graham hello, i use logic:iterate and want to change the cgcolor every row. usualy i do something like this thisway: if(currentrow mod 2 == 0) { bgcolor = color1; } else { bgcolor = color2; } how would u do this with struts ? i would prefer to do this without any jsp, so far my code is struts only :) any ideas ? Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - 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 with changing row colors
here are means to do it: http://husted.com/struts/FAQ/view-logic.htm -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 3:17 PM To: Struts-User Subject: logic:iterate with changing row colors hello, i use logic:iterate and want to change the cgcolor every row. usualy i do something like this thisway: if(currentrow mod 2 == 0) { bgcolor = color1; } else { bgcolor = color2; } how would u do this with struts ? i would prefer to do this without any jsp, so far my code is struts only :) any ideas ? Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - 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: RE : logic:iterate with changing row colors
You definitely need Niall Pemberton's row tag (from that link). On 09/16/2003 04:55 PM thomas Sontheimer wrote: here are means to do it: http://husted.com/struts/FAQ/view-logic.htm -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 3:17 PM To: Struts-User Subject: logic:iterate with changing row colors hello, i use logic:iterate and want to change the cgcolor every row. usualy i do something like this thisway: if(currentrow mod 2 == 0) { bgcolor = color1; } else { bgcolor = color2; } how would u do this with struts ? i would prefer to do this without any jsp, so far my code is struts only :) any ideas ? Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - 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] -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate
logic:iterate name=editResourceAttributesForm property=indexedBeans id=indexedBean bean:write name=indexedBean property=id /logic:iterate This will use the editResourceAttributesForm bean and retrieve the arraylist named indexedBeans from it, then will iterate through the list putting each element in the arraylist into the variable named indexedBean. then inside the tags I output the id property of indexedBean. -Good Luck David - Original Message - From: Ian Joyce [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 29, 2003 1:56 PM Subject: logic:iterate Hi, Can someone give me an example of how to iterate over an ArrayList of Strings using the iterate logic tag? Thanks - 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 and bean:define
Is it possible that this is done in your business logic layer before you present the bean (from whatever scope) to the iterator tag ? Thamarajah Dharma wrote: Hi all. I have a requirement to check and validate values of the object which is been iterated inside the iterator tag. (i.e) i need to get two object and see whether it has any duplicate elements. problem i'm facing is that within a single iteration how to get the first second object in the iterator tag. just wanted to know wether this is possible using bean define tag. If so, how to do it. i know that this can be done using scriplets but just wanted to try if the same thing can be done using taglib. any help in this is appreciated. Thanx in advance regards sasi - 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
Watch out your method public int getID() It should be public int getiID() instead. This should work. Regards Prashant Samant [EMAIL PROTECTED] wrote: Hello group, I have a problem in using logic:iterate. I have a following class public class DataWrapper implements Serializable { private int iID; private String strDescription; public int getID() { return iID; } // DataWrapper : getID public void setiID(int iID) { this.iID = iID; } // DataWrapper : setiID public String getDescription() { return strDescription; } // DataWrapper : getDescription public void setDescription(String strDescription) { this.strDescription = strDescription; } // DataWrapper : setDescription } // DataWrapper In my ActionForm i am creating 5 objects of the above class and settting the values for iID and strDescription. After this i am putting this objects in a vector and this vector i am putting inside request object(saying request.setAttribute(vect,vector) ). The ActionForm than calls a jsp page in which i want to populate a drop-down box with the values of iId variable of the above bean. I am trying to do something like this if i execute the above code than i get the following error No getter method for property iId of bean myObj Pls Help . Prashant S MphasiS India IInd Floor, Leela Business Park, Opp. 'The Leela' Andheri Kurla Road, Andheri (E), Mumbai. INDIA. www.mphasis.com Architecting Value SEI Level 5 ISO 9001 Information transmitted by this e-mail is proprietary to MphasiS and/ or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this mail from your records. - 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
RE: logic:iterate
Thanx for the response. I tried both public int getiID() as well as public int getIID() . But still the error persist. Any clue?. Prashant S. -Original Message- From: Vinit Sharma [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 12:02 PM To: Struts Users Mailing List Subject: Re: logic:iterate Watch out your method public int getID() It should be public int getiID() instead. This should work. Regards Prashant Samant [EMAIL PROTECTED] wrote: Hello group, I have a problem in using logic:iterate. I have a following class public class DataWrapper implements Serializable { private int iID; private String strDescription; public int getID() { return iID; } // DataWrapper : getID public void setiID(int iID) { this.iID = iID; } // DataWrapper : setiID public String getDescription() { return strDescription; } // DataWrapper : getDescription public void setDescription(String strDescription) { this.strDescription = strDescription; } // DataWrapper : setDescription } // DataWrapper In my ActionForm i am creating 5 objects of the above class and settting the values for iID and strDescription. After this i am putting this objects in a vector and this vector i am putting inside request object(saying request.setAttribute(vect,vector) ). The ActionForm than calls a jsp page in which i want to populate a drop-down box with the values of iId variable of the above bean. I am trying to do something like this if i execute the above code than i get the following error No getter method for property iId of bean myObj Pls Help . Prashant S MphasiS India IInd Floor, Leela Business Park, Opp. 'The Leela' Andheri Kurla Road, Andheri (E), Mumbai. INDIA. www.mphasis.com Architecting Value SEI Level 5 ISO 9001 Information transmitted by this e-mail is proprietary to MphasiS and/ or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this mail from your records. - 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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate
It's all about case (upper/lower) property=iId -- calls getIId() property=iID -- calls getIID() ... The underlying BeanUtils will capitalize first letter of property and prepend get/set... -Original Message- From: Prashant Samant [mailto:[EMAIL PROTECTED] Sent: vrijdag 25 juli 2003 8:35 To: Struts Users Mailing List Subject: RE: logic:iterate Thanx for the response. I tried both public int getiID() as well as public int getIID() . But still the error persist. Any clue?. Prashant S. -Original Message- From: Vinit Sharma [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 12:02 PM To: Struts Users Mailing List Subject: Re: logic:iterate Watch out your method public int getID() It should be public int getiID() instead. This should work. Regards Prashant Samant [EMAIL PROTECTED] wrote: Hello group, I have a problem in using logic:iterate. I have a following class public class DataWrapper implements Serializable { private int iID; private String strDescription; public int getID() { return iID; } // DataWrapper : getID public void setiID(int iID) { this.iID = iID; } // DataWrapper : setiID public String getDescription() { return strDescription; } // DataWrapper : getDescription public void setDescription(String strDescription) { this.strDescription = strDescription; } // DataWrapper : setDescription } // DataWrapper In my ActionForm i am creating 5 objects of the above class and settting the values for iID and strDescription. After this i am putting this objects in a vector and this vector i am putting inside request object(saying request.setAttribute(vect,vector) ). The ActionForm than calls a jsp page in which i want to populate a drop-down box with the values of iId variable of the above bean. I am trying to do something like this if i execute the above code than i get the following error No getter method for property iId of bean myObj Pls Help . Prashant S MphasiS India IInd Floor, Leela Business Park, Opp. 'The Leela' Andheri Kurla Road, Andheri (E), Mumbai. INDIA. www.mphasis.com Architecting Value SEI Level 5 ISO 9001 Information transmitted by this e-mail is proprietary to MphasiS and/ or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this mail from your records. - 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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential and proprietary material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies. Ce Message est uniquement destiné aux récipiendaires indiqués et peut contenir des informations confidentielles. Si vous n'êtes pas le récipiendaire, vous ne devez pas révéler le contenu de ce message ou en prendre copie. Si vous avez reçu ce message par erreur, veuillez en informer l'expéditeur, ou La Poste immédiatement, avant de le supprimer. Dit bericht is enkel bestemd voor de aangeduide ontvangers en kan vertrouwelijke informatie bevatten. Als u niet de ontvanger bent, dan mag u de inhoud van dit bericht niet bekendmaken noch kopiëren. Als u dit bericht per vergissing heeft ontvangen, gelieve er de afzender of De Post onmiddellijk van op de hoogte te brengen en het bericht vervolgens te verwijderen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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 index question
use jstl: logic:iterate id=people name=employees indexId=index c:if test=${index%2==0} tr class='Even' /c:if c:if test=${index%2==1} tr class='Odd' /c:if ... /logic:iterate Of course you can use a c:choose if you like and several other options but thats just a start. -Tim -Original Message- From: Charles Liu [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 12:00 PM To: [EMAIL PROTECTED] Subject: logic:iterate index question Hi, What is the best way to test the value of indexId? For example, logic:iterate id=people name=employees indexId=index tr class='%=index.intValue()%2==0?Even:Odd%' ... /logic:iterate This works but it depends on the fact that index has type of Integer. Is there a better way to do the same kind of testing but hide the implementation detail? Thanks -- Charles Liu - 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 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 question
The following link should help: http://www.mail-archive.com/[EMAIL PROTECTED]/msg71256.html however it talks about using el, but this is not necessary. I have got the nested tags to work properly. The logic tag should work, but I think I was doing something slightly wrong when I tried. Remember to have getMap(String key) and setMap(String key, Object value) in your form. The online help has more on this. sandeep --- [EMAIL PROTECTED] wrote: hi all, i have a Map-backed action Form which contains an HashMap the ActionForm is as follows public MapActionForm extends ActionForm { HashMap table = new HashMap(); public void setValue(String key, String value) { ... } public Object getValue(String key) { .. } public HashMap getTable() { return table; } } in one of jsp i have to display a textfield for each key contained in the HashMap. i have written following code (name of the bean is DisplayKeys) logic:iterate id=params collection=%= displayKeys.getTable() % tr tdbean:write name=params//td tdhtml:text property=value(bean:write name=params/)//td /tr /logic:iterate but when i get into the page (after populating the bean) i got following exception: org.apache.jasper.JasperException: /callservice.jsp(53,79) equal symbol expected the hashmap contains parameter names. in the jps i want to display the name of the parameter (done with bean:write name=params) and i want to display close to teh name an input text with the name of the parameter.. Example: in the map i have following values param1, param2, and in the jsp i want to display param1 : input type=text name=param1/ anyone can give me some help? regards marco - 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 length question
Hello Nadja, according to the docs: The length value or attribute name (=0 means no limit). Thus, it's a feature. *** WN Hello all, WN I have a question regarding the length attribute of logic:iterate. If I set it to 0 it seems to ignore the length attribute and iterate through the whole collection. Is that a bug or a WN feature? WN Thanks WN Kind regards WN Nadja Weber WN T-Systems WN Systems Integration WN Business Unit Entwicklungszentrum Darmstadt WN T-Systems Nova GmbH WN Office: Otto-Rohm-Str. 71c, 64293 Darmstadt WN Mail: Postfach 10 05 41, 64205 Darmstadt WN Phone: 06151 886-4162 WN Fax: 06151 886-161 WN mailto:[EMAIL PROTECTED] WN Internet: http://www.t-systems.com WN - WN To unsubscribe, e-mail: [EMAIL PROTECTED] WN For additional commands, e-mail: [EMAIL PROTECTED] Regards, Dirk +--- Quality leads ---+ | Dirk Markert [EMAIL PROTECTED] | | Dr. Markert Softwaretechnik AG | | Joseph-von-Fraunhofer-Str. 20 | | 44227 Dortmund | +-- to success! -+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate using HashMap
O_Parthasarathy Kesavaraj rta: How to iterate thro HashMap using logic:iterate? You did not look into the docs, did you? http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate Normally, each object exposed by the iterate tag is an element of the underlying collection you are iterating over. However, if you iterate over a |Map|, the exposed object is of type |Map.Entry| that has two properties: * |key| - The key under which this item is stored in the underlying Map. * |value| - The value that corresponds to this key. Tib
RE: logic:iterate using HashMap
-- From: Gemes Tibor[SMTP:[EMAIL PROTECTED] Reply To: Struts Users Mailing List Sent: Tuesday, June 24, 2003 7:46 PM To: Struts Users Mailing List Subject: Re: logic:iterate using HashMap O_Parthasarathy Kesavaraj rta: Thanks Tib.I did look at the docs.But i got struck up.If u have any sample code pls send. Regards Partha How to iterate thro HashMap using logic:iterate? You did not look into the docs, did you? http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate Normally, each object exposed by the iterate tag is an element of the underlying collection you are iterating over. However, if you iterate over a |Map|, the exposed object is of type |Map.Entry| that has two properties: * |key| - The key under which this item is stored in the underlying Map. * |value| - The value that corresponds to this key. Tib - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate using HashMap
On Tue, 2003-06-24 at 10:46, O_Parthasarathy Kesavaraj wrote: O_Parthasarathy Kesavaraj írta: Thanks Tib.I did look at the docs.But i got struck up.If u have any sample code pls send. I admit the docs I think are lame on this area. This should work.. logic:iterate id=element name=yourMap bean:write name=element property=key/ - bean:write name=element property=value/BR /logic:iterate JSTL should be something like... c:forEach var=element items=${yourMap} c:out value=${element.key}/ - c:out value=${element.value}/br /c:forEach -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate using HashMap
Thanks rick.I loaded a select box containing id and values like this bean:define id=company name=companies / html:select property=companyID html:options collection=company property=key labelProperty=value/ /html:select Regards Partha -- From: Rick Reumann[SMTP:[EMAIL PROTECTED] Reply To: Struts Users Mailing List Sent: Tuesday, June 24, 2003 8:28 PM To: Struts Users Mailing List Subject: RE: logic:iterate using HashMap Thanks rick.I loaded a select box containing id and values like this bean:define id=company name=companies / html:select property=companyID html:options collection=company property=key labelProperty=value/ /html:select Regards Partha On Tue, 2003-06-24 at 10:46, O_Parthasarathy Kesavaraj wrote: O_Parthasarathy Kesavaraj írta: Thanks Tib.I did look at the docs.But i got struck up.If u have any sample code pls send. I admit the docs I think are lame on this area. This should work.. logic:iterate id=element name=yourMap bean:write name=element property=key/ - bean:write name=element property=value/BR /logic:iterate JSTL should be something like... c:forEach var=element items=${yourMap} c:out value=${element.key}/ - c:out value=${element.value}/br /c:forEach -- Rick - 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 - Pls Help.........
You might need to add this before your logic:iterate: bean:define id=myCollectionElement name=list / -Original Message- From: Shashank Dixit [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2003 7:44 AM To: Struts Users Mailing List Subject: Logic:Iterate - Pls Help. Hello All Can somebody pls explain how to use Logic:iterate I am using following code logic:iterate id=myCollectionElement name=list type=com.dl.bi.vo.ArticleVo scope=page bean:write name=myCollectionElement property=articleId/ bean:write name=myCollectionElement property=title/br / /logic:iterate What I understood from the documents is myCollection element will be create when in doStartTag of logic:iterate. And it will be stored in pageContext so that WriteTag will access it. But I got the error that myCollectionElement is not found in any scope Can somebody pls explain this. or correct me if I am wrong. Thanks in advance Shashank S. Dixit Senior Software Engineer Datamatics Ltd. Contact: 28291253 ext 133 Mobile: 9820930075 Be brave against all odds. Never give up. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logic:iterate
HI, where is ur "list" coming from?? ---Original Message--- From: Struts Users Mailing List Date: Friday, June 20, 2003 11:22:39 AM To: Struts Users Mailing List Subject: Logic:iterate Hello AllCan somebody pls explain how to use Logic:iterateI am using following codelogic:iterate id="myCollectionElement" name="list" type="com.dl.bi.vo.ArticleVo" scope="page"bean:write name="myCollectionElement" property="articleId"/bean:write name="myCollectionElement" property="title"/br //logic:iterateWhat I understood from the documents is myCollection element will be create whenin doStartTag of logic:iterate. And it will be stored in pageContext so that WriteTag will access it. But I got the error that "myCollectionElement" is not found in any scopeCan somebody pls explain this. or correct me if I am wrong.Thanks in advanceShashank S. Dixit Senior Software Engineer Datamatics Ltd. Contact: 28291253 ext 133 Mobile: 9820930075 Be brave against all odds. Never give up. IncrediMail - Email has finally evolved - Click Here
Re: Logic:iterate
I have set the list attribute list as follows. result.getArticleListDate returns ArrayList of ValueObjects com.dl.bi.vo.ArticleVo pageContext.setAttribute(list, result.getArticleListData(), PageContext.PAGE_SCOPE); And then I did the following logic:iterate id=myCollectionElement name=list type=com.dl.bi.vo.ArticleVo scope=page bean:write name=myCollectionElement property=articleId/ bean:write name=myCollectionElement property=title/br / /logic:iterate But i got the error myCollectionElement not found in any scope. What is the mistake? Shashank S. Dixit Senior Software Engineer Datamatics Ltd. Contact: 28291253 ext 133 Mobile: 9820930075 Be brave against all odds. Never give up. - Original Message - From: Nagendra Kumar O V S To: [EMAIL PROTECTED] Sent: Friday, June 20, 2003 11:53 AM Subject: Re: Logic:iterate HI, where is ur list coming from?? ---Original Message--- From: Struts Users Mailing List Date: Friday, June 20, 2003 11:22:39 AM To: Struts Users Mailing List Subject: Logic:iterate Hello All Can somebody pls explain how to use Logic:iterate I am using following code logic:iterate id=myCollectionElement name=list type=com.dl.bi.vo.ArticleVo scope=page bean:write name=myCollectionElement property=articleId/ bean:write name=myCollectionElement property=title/br / /logic:iterate What I understood from the documents is myCollection element will be create when in doStartTag of logic:iterate. And it will be stored in pageContext so that WriteTag will access it. But I got the error that myCollectionElement is not found in any scope Can somebody pls explain this. or correct me if I am wrong. Thanks in advance Shashank S. Dixit Senior Software Engineer Datamatics Ltd. Contact: 28291253 ext 133 Mobile: 9820930075 Be brave against all odds. Never give up. IncrediMail - Email has finally evolved - Click Here
Re: logic:iterate displaying blanks
I think you want to do a html:form action=/showLogs.do ? also, check to see what your html source is for this form line and verify that it is using the name element from your struts-config. sandeep --- RALPH ROPER [EMAIL PROTECTED] wrote: hi, I had a good search on the user group and could not find any answer for this one. I have a DispatchAction class, called ShowLogsAction that goes away and returns a list of LogItem items. All the properties on LogItem are public eg public String auditDate ShowLogsAction snippet System.out.println(Entering ShowLogAction); ValueListHandler listHandler = new LogListHandler(); DynaActionForm logForm = (DynaActionForm) form; List logs = listHandler.getNextElements(20); ArrayList logList = new ArrayList(); for(Iterator i = logs.iterator(); i.hasNext();){ LogItem log = (LogItem) i.next(); System.out.println(action date= + log.auditDate); logList.add(log); } logForm.set(logList, logList); /snippet I have iterated through the Collection again in the action just to make sure the values are being returned. Everything looks OK to this point. In my jsp, showLogs.jsp, I then iterate over the Collection and print the date and and userNaem properties of the LogItem in the Collection. This is done as so. showLogs.jsp snippet % String forward = /showLogs; % html:form action=%= forward % TABLE border=1 TBODY logic:iterate id=logs name=logsForm property=logList scope=request type=com.cuscal.payments.bpay.enquiry.LogItem TR TDauditDate= bean:write name=logs property=auditDate / /TD TDuser name= bean:write name=logs property=userName / /TD /TR /logic:iterate /TBODY /TABLE /html:form /snippet While I get 20 rows back they are all blank. This is the result. auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= Obviously this has caused me hours of amusement. Can anyone think why this would be producing such a result? All suggestions gratefully appreciated. Ralph Roper NOTICE The information in this email and or any of the attachments may contain; a. Confidential information of Credit Union Services Corporation (Australia) Limited (CUSCAL) or third parties; and or b. Legally privileged information of CUSCAL or third parties; and or c. Copyright material of CUSCAL or third parties. If you are not an authorised recipient of this email, please contact CUSCAL immediately by return email or by telephone on 61-2-8299 9000 and delete the email from your system. We do not accept any liability in connection with computer virus, data corruption, interruption or any damage generally as a result of transmission of this email. - 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 problems
Hello! I tried that (I found I needed to change Collection c to java.util.Collection c, so the compiler would not complain) but I'm still experiancing the same problem: org.apache.jasper.JasperException: Cannot create iterator for this collection I added some print statements to help me debug, and I know that the getProductLines() method is being called, so this *should* be working. I'm at a loss. Here's the full stack trace if it will help anyone. Thanks in advance for any insight anyone has. Cheers! org.apache.jasper.JasperException: Cannot create iterator for this collection at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:536) root cause javax.servlet.ServletException: Cannot create iterator for this collection at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.toolDevelopmentRequest_jsp._jspService(toolDevelopmentRequest_jsp.java:147) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at
Re: logic:iterate problems
If i were you, i would check like this in my jsp: %@ page import=java.util.Collection % %@ page import=java.util.Iterator % % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); % do not logic:iterate yet util the above code run ok.And then you can be sure that the previous logic:iterate should run with no problem. the logic:iterate tag handler will always try to retrieve the object from one of the 4 scopes ie. page,request,session,application that you placed sometime before. --- Matt E [EMAIL PROTECTED] Hello! I tried that (I found I needed to change Collection c to java.util.Collection c, so the compiler would not complain) but I'm still experiancing the same problem: org.apache.jasper.JasperException: Cannot create iterator for this collection I added some print statements to help me debug, and I know that the getProductLines() method is being called, so this *should* be working. I'm at a loss. Here's the full stack trace if it will help anyone. Thanks in advance for any insight anyone has. Cheers! org.apache.jasper.JasperException: Cannot create iterator for this collection at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:536) root cause javax.servlet.ServletException: Cannot create iterator for this collection at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.toolDevelopmentRequest_jsp._jspService(toolDevelopmentRequest_jsp.java:147) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at
Re: logic:iterate problems
% Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); % This worked as expected. It wrote: [EMAIL PROTECTED] to the HTML, which leads me to belive that the collection is returning an iterator. I then tried this (after deleting the above): % Collection c = ...getProductLines(); request.setAttribute(colName,c); % logic:iterate id=productLines collection=colName Is this working? /logic:iterate However, when I introduce the logic iterate tag, I get the same Cannot create iterator for this collection error. I'd really like to not have to drop back to coding Java to do the Iteration, since the taglib seems cleaner to me. Any ideas what to try? __ 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 problems
Hello, Try to put your collection in the pageContext and not in the request... Strut's tags works a lot with the pageContext... -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: mardi, 17. juin 2003 17:09 To: Struts Users Mailing List Subject: Re: logic:iterate problems % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); % This worked as expected. It wrote: [EMAIL PROTECTED] to the HTML, which leads me to belive that the collection is returning an iterator. I then tried this (after deleting the above): % Collection c = ...getProductLines(); request.setAttribute(colName,c); % logic:iterate id=productLines collection=colName Is this working? /logic:iterate However, when I introduce the logic iterate tag, I get the same Cannot create iterator for this collection error. I'd really like to not have to drop back to coding Java to do the Iteration, since the taglib seems cleaner to me. Any ideas what to try? __ 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] *** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager to [EMAIL PROTECTED] *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate problems
Hello! Changed the code to read: % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); pageContext.setAttribute(colName,c); % However it still fails with the same problem. Cheers. --- Valery Jacot [EMAIL PROTECTED] wrote: Hello, Try to put your collection in the pageContext and not in the request... Strut's tags works a lot with the pageContext... -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: mardi, 17. juin 2003 17:09 To: Struts Users Mailing List Subject: Re: logic:iterate problems % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); % This worked as expected. It wrote: [EMAIL PROTECTED] to the HTML, which leads me to belive that the collection is returning an iterator. I then tried this (after deleting the above): % Collection c = ...getProductLines(); request.setAttribute(colName,c); % logic:iterate id=productLines collection=colName Is this working? /logic:iterate However, when I introduce the logic iterate tag, I get the same Cannot create iterator for this collection error. I'd really like to not have to drop back to coding Java to do the Iteration, since the taglib seems cleaner to me. Any ideas what to try? __ 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] *** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager to [EMAIL PROTECTED] *** - 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 problems
logic:iterate id=productLines name=colName Next element is bean:write name=productLines property=blah/ /logic:iterate Doesn't matter what scope you put it in. -Tim -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 11:23 AM To: Struts Users Mailing List Subject: RE: logic:iterate problems Hello! Changed the code to read: % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); pageContext.setAttribute(colName,c); % However it still fails with the same problem. Cheers. --- Valery Jacot [EMAIL PROTECTED] wrote: Hello, Try to put your collection in the pageContext and not in the request... Strut's tags works a lot with the pageContext... -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: mardi, 17. juin 2003 17:09 To: Struts Users Mailing List Subject: Re: logic:iterate problems % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); % This worked as expected. It wrote: [EMAIL PROTECTED] to the HTML, which leads me to belive that the collection is returning an iterator. I then tried this (after deleting the above): % Collection c = ...getProductLines(); request.setAttribute(colName,c); % logic:iterate id=productLines collection=colName Is this working? /logic:iterate However, when I introduce the logic iterate tag, I get the same Cannot create iterator for this collection error. I'd really like to not have to drop back to coding Java to do the Iteration, since the taglib seems cleaner to me. Any ideas what to try? __ 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] *** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager to [EMAIL PROTECTED] *** - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate problems
Worked like a charm. I noticed that you removed the collection argument and changed it to a name argument. For the archives, here's the complete code: % Collection c = org.ellism.tir.util.DatabaseConstantsAdapter.getInstance().getProductLines(); pageContext.setAttribute(productLineCollection,c); % logic:iterate id=productLine name=productLineCollection Next element is bean:write name=productLine property=name/ /logic:iterate Thanks! --- Chen, Gin [EMAIL PROTECTED] wrote: logic:iterate id=productLines name=colName Next element is bean:write name=productLines property=blah/ /logic:iterate Doesn't matter what scope you put it in. -Tim -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 11:23 AM To: Struts Users Mailing List Subject: RE: logic:iterate problems Hello! Changed the code to read: % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); pageContext.setAttribute(colName,c); % However it still fails with the same problem. Cheers. --- Valery Jacot [EMAIL PROTECTED] wrote: Hello, Try to put your collection in the pageContext and not in the request... Strut's tags works a lot with the pageContext... -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: mardi, 17. juin 2003 17:09 To: Struts Users Mailing List Subject: Re: logic:iterate problems % Collection c = ...getProductLines(); Iterator it = c.iterator(); out.print(it); % This worked as expected. It wrote: [EMAIL PROTECTED] to the HTML, which leads me to belive that the collection is returning an iterator. I then tried this (after deleting the above): % Collection c = ...getProductLines(); request.setAttribute(colName,c); % logic:iterate id=productLines collection=colName Is this working? /logic:iterate However, when I introduce the logic iterate tag, I get the same Cannot create iterator for this collection error. I'd really like to not have to drop back to coding Java to do the Iteration, since the taglib seems cleaner to me. Any ideas what to try? __ 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] *** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager to [EMAIL PROTECTED] *** - 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] - 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 displaying blanks
/tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr /tbody /table /form /body /html:html Ralph -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 June 2003 9:25 PM To: Struts Users Mailing List Subject: Re: logic:iterate displaying blanks I think you want to do a html:form action=/showLogs.do ? also, check to see what your html source is for this form line and verify that it is using the name element from your struts-config. sandeep --- RALPH ROPER [EMAIL PROTECTED] wrote: hi, I had a good search on the user group and could not find any answer for this one. I have a DispatchAction class, called ShowLogsAction that goes away and returns a list of LogItem items. All the properties on LogItem are public eg public String auditDate ShowLogsAction snippet System.out.println(Entering ShowLogAction); ValueListHandler listHandler = new LogListHandler(); DynaActionForm logForm = (DynaActionForm) form; List logs = listHandler.getNextElements(20); ArrayList logList = new ArrayList(); for(Iterator i = logs.iterator(); i.hasNext();){ LogItem log = (LogItem) i.next(); System.out.println(action date= + log.auditDate); logList.add(log); } logForm.set(logList, logList); /snippet I have iterated through the Collection again in the action just to make sure the values are being returned. Everything looks OK to this point. In my jsp, showLogs.jsp, I then iterate over the Collection and print the date and and userNaem properties of the LogItem in the Collection. This is done as so. showLogs.jsp snippet % String forward = /showLogs; % html:form action=%= forward % TABLE border=1 TBODY logic:iterate id=logs name=logsForm property=logList scope=request type=com.cuscal.payments.bpay.enquiry.LogItem TR TDauditDate= bean:write name=logs property=auditDate / /TD TDuser name= bean:write name=logs property=userName / /TD /TR /logic:iterate /TBODY /TABLE /html:form /snippet While I get 20 rows back they are all blank. This is the result. auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= Obviously this has caused me hours of amusement. Can anyone think why this would be producing such a result? All suggestions gratefully appreciated. Ralph Roper NOTICE The information in this email and or any of the attachments may contain; a. Confidential information of Credit Union Services Corporation (Australia) Limited (CUSCAL) or third parties; and or b. Legally privileged information of CUSCAL or third parties; and or c. Copyright material of CUSCAL or third parties. If you are not an authorised recipient of this email, please contact CUSCAL immediately by return email or by telephone on 61-2-8299 9000 and delete the email from your system. We do not accept any liability in connection with computer virus, data corruption
RE: logic:iterate displaying blanks
tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr /tbody /table /form /body /html:html Ralph -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 June 2003 9:25 PM To: Struts Users Mailing List Subject: Re: logic:iterate displaying blanks I think you want to do a html:form action=/showLogs.do ? also, check to see what your html source is for this form line and verify that it is using the name element from your struts-config. sandeep --- RALPH ROPER [EMAIL PROTECTED] wrote: hi, I had a good search on the user group and could not find any answer for this one. I have a DispatchAction class, called ShowLogsAction that goes away and returns a list of LogItem items. All the properties on LogItem are public eg public String auditDate ShowLogsAction snippet System.out.println(Entering ShowLogAction); ValueListHandler listHandler = new LogListHandler(); DynaActionForm logForm = (DynaActionForm) form; List logs = listHandler.getNextElements(20); ArrayList logList = new ArrayList(); for(Iterator i = logs.iterator(); i.hasNext();){ LogItem log = (LogItem) i.next(); System.out.println(action date= + log.auditDate); logList.add(log); } logForm.set(logList, logList); /snippet I have iterated through the Collection again in the action just to make sure the values are being returned. Everything looks OK to this point. In my jsp, showLogs.jsp, I then iterate over the Collection and print the date and and userNaem properties of the LogItem in the Collection. This is done as so. showLogs.jsp snippet % String forward = /showLogs; % html:form action=%= forward % TABLE border=1 TBODY logic:iterate id=logs name=logsForm property=logList scope=request type=com.cuscal.payments.bpay.enquiry.LogItem TR TDauditDate= bean:write name=logs property=auditDate / /TD TDuser name= bean:write name=logs property=userName / /TD /TR /logic:iterate /TBODY /TABLE /html:form /snippet While I get 20 rows back they are all blank. This is the result. auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= Obviously this has caused me hours of amusement. Can anyone think why this would be producing such a result? All suggestions gratefully appreciated. Ralph Roper NOTICE The information in this email and or any of the attachments may contain; a. Confidential information of Credit Union Services Corporation (Australia) Limited (CUSCAL) or third parties; and or b. Legally privileged information of CUSCAL or third parties; and or c. Copyright material of CUSCAL or third parties. If you are not an authorised
RE: logic:iterate displaying blanks
Sandeep, you are spot on. I cannot believe I have wasted a few hours over this. Thankyou very much. Ralph -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Wednesday, 18 June 2003 10:13 AM To: Struts Users Mailing List Subject: RE: logic:iterate displaying blanks looks like you haven't added the struts-bean taglib definition because it has not converted your bean:writes to anything (they are still xml in your html source). sandeep --- RALPH ROPER [EMAIL PROTECTED] wrote: Sandeep, thanks for the reply. I have done the following to try and rectify the problem. The LogItem class was declaring public class variables. I changed these to private and provided public getter/setter methods. I changed the html:form tag to use action=/showLogs.do. I have looked at the html source (see below). Everything looks OK but I still receive the same result ie 20 rows of blank data. I am getting the feeling I am missing something really obvious here. I have even tried placing the form, LogsForm, into session scope without any luck. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 meta name=GENERATOR content=IBM WebSphere Studio titleshowLogs.jsp/title /head body pPlace showLogs.jsp's content here./p form name=logsForm method=post action=/BPayWeb/showLogs.do table border=1 tbody tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td /tr tr tdauditDate= bean:write name=logs property=auditDate / /td tduser name= bean:write name=logs property=userName / /td
RE: logic:iterate issue
Offset property is there in iterate check it up please -Original Message- From: raghu_c [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 12:54 PM To: [EMAIL PROTECTED] Subject: logic:iterate issue Hi - My logic:iterate tag doesnt loop thru the no of elements in the list :( Can someone help? My jsp goes something like this logic:iterate id=MINESNQueryForm name=MINESNResults property=arrlstMINESNIS41Records length=%=iNoOfRecDisplayed% tr onClick=fnSelectedRow(this,'%=iCounter%') onDblClick=fnOpenDetails(this,'%=iCounter%') td align = center nbsp; /td logic:notEmpty name=MINESNQueryForm property='%=arrIS41Date[+iCounter+]%' td align = center font color=%=(String)arrIS41ColorCode.get(iCounter)% bean:write name=MINESNQueryForm property='%=arrIS41Date[+iCounter+]%' / /font /td /logic:notEmpty /tr %iCounter+=1;% /logic:iterate The MINESNQueryForm is my ActionForm Bean ; it has getter setter methods called getArrlstMINESNIS41Records and setArrlstMINESNIS41Records iNoOfRecords is a parameter, it has a value of 15 when printed to System.out I am forced to use the iCounter to iterate since tag nesting is unavailable. It prints the first record , then doesnt return to loop any more Thanx in Advance, Raghu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate issue
Default offset is zero , is it not? -Original Message- From: J, Sadhasivam (Cognizant) [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 1:00 PM To: Struts Users Mailing List Subject: RE: logic:iterate issue Offset property is there in iterate check it up please -Original Message- From: raghu_c [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 12:54 PM To: [EMAIL PROTECTED] Subject: logic:iterate issue Hi - My logic:iterate tag doesnt loop thru the no of elements in the list :( Can someone help? My jsp goes something like this logic:iterate id=MINESNQueryForm name=MINESNResults property=arrlstMINESNIS41Records length=%=iNoOfRecDisplayed% tr onClick=fnSelectedRow(this,'%=iCounter%') onDblClick=fnOpenDetails(this,'%=iCounter%') td align = center nbsp; /td logic:notEmpty name=MINESNQueryForm property='%=arrIS41Date[+iCounter+]%' td align = center font color=%=(String)arrIS41ColorCode.get(iCounter)% bean:write name=MINESNQueryForm property='%=arrIS41Date[+iCounter+]%' / /font /td /logic:notEmpty /tr %iCounter+=1;% /logic:iterate The MINESNQueryForm is my ActionForm Bean ; it has getter setter methods called getArrlstMINESNIS41Records and setArrlstMINESNIS41Records iNoOfRecords is a parameter, it has a value of 15 when printed to System.out I am forced to use the iCounter to iterate since tag nesting is unavailable. It prints the first record , then doesnt return to loop any more Thanx in Advance, Raghu - 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 problems
try something like: % Collection c = org.ellism.tir.util.DatabaseConstantsAdapter.getInstance().getProductLines(); request.setAttribute(colName,c); % and then: logic:iterate id=... collection=colName... /logic:iterate you can alse put your collection into the jsp scope variable somewhere in your action. hope it helps. guo --- Matt E [EMAIL PROTECTED] Hello All! I'm running into some problems getting the logic:iterate tag to work. I have a class who's full name is org.ellism.tir.util.DatabaseConstantsAdapter. It has a public method, getInstance() that returns an instance of itself (The class itself is a singleton). This class has a method getProductLines() that returns an ArrayList full of org.ellis.tir.util.ProductLineToken objects. I'd like to iterate over this collection and print some stuff out. I've tried this: %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % ...Lots of HTML code... logic:iterate id=productLine collection=% org.ellism.tir.util.DatabaseConstantsAdapter.getInstance().getProductLines(); % The name is: bean:write name=productLine property=name/. /logic:iterate However this doesn't seem to work, I get this error: org.apache.jasper.JasperException: Cannot create iterator for this collection ..Stack Trace I'm not sure why this happens? The object returned by org.ellism.tir.util.DatabaseConstantsAdapter.getInstance().getProductLines() is of type ArrayList, and I thought that was a valid collection to iterate over? Any insights would be wonderful. Cheers! __ 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] _ Do You Yahoo!? http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.surveys.yahoo.com/cn_user_profile_study_may2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate ActionForm array
It works fine for the taglib test suite. Can you post your action code (where you setup the array and store it in the request/session)? You ARE using a defined form on the page right? -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - Original Message - From: Michael C. Clark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 13, 2003 12:55 PM Subject: logic:iterate ActionForm array I'm trying to populate a multibox from an array that lives in my ActionForm (like the example in Ted's book p. 298). I keep getting a NullPointerException when the logic:iterate tag trys to read the String array property from the ActionForm. If I create the String array in the JSP and set it to the PageContext, all works fine. Seems I should easily be able to call it from the ActionForm though...it's just a bean after all. In the JSP I'm using logic:iterate id=name property=names ... /logic:iterate Where names is the String array in the ActionForm. Thanks, Mike Clark - 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 and html:text indexed='true'/
Thanks for all the info! I'll look into it all and see if I can't get my little form working one way or the other. :) Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate and html:text indexed=true/
Try using name=element in html:text along with indexed tag.. I think you have to make available the element bean to html:text tag... -Original Message- From: Nadja Senoucci [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 1:23 PM To: [EMAIL PROTECTED] Subject: logic:iterate and html:text indexed=true/ Hello again, I am currently testing around with the above named tags (in order to get around my earlier discribed problem sooner or later) and I don't think I quite understand what happens when you set indexed=true for text fields. I have this little bit of code in my .jsp: logic:present name=cntarr bean:define name=cntarr scope=session id=cntarr type=java.util.Collection/ logic:iterate id=element name=cntarr tr bgcolor=#FF td colspan=2html:text property=searchfield indexed=true//td td colspan=2html:text property=searchparam indexed=true//td /tr /logic:iterate /logic:present And it seems that this results in the following bit of HTML: tr bgcolor=#FF td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td /tr Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I would have thought it would be element[0].searchfield... And what do I need to do in my form bean to create set-methods for this? Meaning: What does Struts expect to find in my form bean if I am using an indexed field as shown above? At the moment, I keep getting an index out of bounds-exception which is quite natural, I think, since there is no array that could be set with something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So I know, I am using these tags wrong. I just can't find out how to use them correctly... Greetings, Nadja - 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 and html:text indexed='true'/
Try using name=element in html:text along with indexed tag.. I think you have to make available the element bean to html:text tag... If I do that (tried it out) I will have to create a whole bean around this because it is asking for get-/set-methods in that bean now. And I still don't know what those methods would have to look like, that is what struts is expecting... Does anyone know of a good (online) resource exlaining the use of these tags or some example code? I am pretty much at a loss... Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logic:iterate
This is because row is defined on the page as a String. (getIterator() returns an array of String) Based on the jsp snippet you've provided, I'm not understanding what you are trying to do. Can you explain further? -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org - Original Message - From: Sashi Ravipati [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 9:33 AM Subject: Logic:iterate i have the following code in my .jsp TABLE id=mytable logic:equal property=amount name=addRateForm value=1 logic:iterate id=row name=addRateForm property=iterator tr tdhtml:text name=row property=firstName //td /tr /logic:iterate /logic:equal tr tdhtml:text property=firstName //td /tr /TABLE in my action form I have private String[] FirstName={}; private String[] iterator={,}; // For testing i initialised to 2 values public String[] getFirstName(){ return FirstName; } public void setFirstName(String[] newName){ FirstName = newName; } public String[] getIterator() { return this.iterator; } public void setIterator(String iterator[]) { this.iterator = iterator; } The above table can have multiple rows. When the page is first loaded one row is displayed, the user can click on a addrow button to create n-rows. Once he is done he will click submit, I would like to submit the page and reload the same page with all the details again in the table (repopulate). It throws the following error-- Error Message: No getter method for property firstName of bean row (I have the get and set methods in my action form) I am new to struts and I think I am missing some thing. PLS help Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logic:iterate
I have a situation of MULTIPLE HTML ELEMENTS WITH THE SAME NAME. So I would like to know is how to repopulate multiple html elements which have the same name. Also I am not aware of the count of HTML elements I will have as it can be 1 or many. In the code I sent I took an example of one HTML element (firstName) Hope I am clear now. [EMAIL PROTECTED] 06/10/03 09:43AM This is because row is defined on the page as a String. (getIterator() returns an array of String) Based on the jsp snippet you've provided, I'm not understanding what you are trying to do. Can you explain further? -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org - Original Message - From: Sashi Ravipati [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 9:33 AM Subject: Logic:iterate i have the following code in my .jsp TABLE id=mytable logic:equal property=amount name=addRateForm value=1 logic:iterate id=row name=addRateForm property=iterator tr tdhtml:text name=row property=firstName //td /tr /logic:iterate /logic:equal tr tdhtml:text property=firstName //td /tr /TABLE in my action form I have private String[] FirstName={}; private String[] iterator={,}; // For testing i initialised to 2 values public String[] getFirstName(){ return FirstName; } public void setFirstName(String[] newName){ FirstName = newName; } public String[] getIterator() { return this.iterator; } public void setIterator(String iterator[]) { this.iterator = iterator; } The above table can have multiple rows. When the page is first loaded one row is displayed, the user can click on a addrow button to create n-rows. Once he is done he will click submit, I would like to submit the page and reload the same page with all the details again in the table (repopulate). It throws the following error-- Error Message: No getter method for property firstName of bean row (I have the get and set methods in my action form) I am new to struts and I think I am missing some thing. PLS help Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logic:iterate
This is similar to what I am trying to accomplish http://www.scioworks.net/devnews/strutsDistilled/updates/update-030401/indexedAttr.html Thanks [EMAIL PROTECTED] 06/10/03 09:43AM This is because row is defined on the page as a String. (getIterator() returns an array of String) Based on the jsp snippet you've provided, I'm not understanding what you are trying to do. Can you explain further? -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org - Original Message - From: Sashi Ravipati [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 9:33 AM Subject: Logic:iterate i have the following code in my .jsp TABLE id=mytable logic:equal property=amount name=addRateForm value=1 logic:iterate id=row name=addRateForm property=iterator tr tdhtml:text name=row property=firstName //td /tr /logic:iterate /logic:equal tr tdhtml:text property=firstName //td /tr /TABLE in my action form I have private String[] FirstName={}; private String[] iterator={,}; // For testing i initialised to 2 values public String[] getFirstName(){ return FirstName; } public void setFirstName(String[] newName){ FirstName = newName; } public String[] getIterator() { return this.iterator; } public void setIterator(String iterator[]) { this.iterator = iterator; } The above table can have multiple rows. When the page is first loaded one row is displayed, the user can click on a addrow button to create n-rows. Once he is done he will click submit, I would like to submit the page and reload the same page with all the details again in the table (repopulate). It throws the following error-- Error Message: No getter method for property firstName of bean row (I have the get and set methods in my action form) I am new to struts and I think I am missing some thing. PLS help Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logic:iterate
In here he talk abt indexed properties . Could not understand You form bean class will look like this: public class MyFormBean extends ActionForm { private List fPersonList; public List getPersonList() { ... } public void getPerson(int index) { ... } } Thanks [EMAIL PROTECTED] 06/10/03 11:16AM This is similar to what I am trying to accomplish http://www.scioworks.net/devnews/strutsDistilled/updates/update-030401/indexedAttr.html Thanks [EMAIL PROTECTED] 06/10/03 09:43AM This is because row is defined on the page as a String. (getIterator() returns an array of String) Based on the jsp snippet you've provided, I'm not understanding what you are trying to do. Can you explain further? -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org - Original Message - From: Sashi Ravipati [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 9:33 AM Subject: Logic:iterate i have the following code in my .jsp TABLE id=mytable logic:equal property=amount name=addRateForm value=1 logic:iterate id=row name=addRateForm property=iterator tr tdhtml:text name=row property=firstName //td /tr /logic:iterate /logic:equal tr tdhtml:text property=firstName //td /tr /TABLE in my action form I have private String[] FirstName={}; private String[] iterator={,}; // For testing i initialised to 2 values public String[] getFirstName(){ return FirstName; } public void setFirstName(String[] newName){ FirstName = newName; } public String[] getIterator() { return this.iterator; } public void setIterator(String iterator[]) { this.iterator = iterator; } The above table can have multiple rows. When the page is first loaded one row is displayed, the user can click on a addrow button to create n-rows. Once he is done he will click submit, I would like to submit the page and reload the same page with all the details again in the table (repopulate). It throws the following error-- Error Message: No getter method for property firstName of bean row (I have the get and set methods in my action form) I am new to struts and I think I am missing some thing. PLS help Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate and html:text indexed=true/
my small understanding on how to use this is as follows: logic:iterate name=form_name property=property_name id=property_name html:text property=some_property indexed=true ok -- 1. form_name is the name of the form 2. property_name is the name of the property and for some reason the id= also has to have the same name 3. indexed=true indicates that property is coming from what we are iterating over. 4. I have only got this to work with forms. So I don't know if it works for session scoped beans and it means that when you submit it will populate the bean. sandeep --- Nadja Senoucci [EMAIL PROTECTED] wrote: Hello again, I am currently testing around with the above named tags (in order to get around my earlier discribed problem sooner or later) and I don't think I quite understand what happens when you set indexed=true for text fields. I have this little bit of code in my .jsp: logic:present name=cntarr bean:define name=cntarr scope=session id=cntarr type=java.util.Collection/ logic:iterate id=element name=cntarr tr bgcolor=#FF td colspan=2html:text property=searchfield indexed=true//td td colspan=2html:text property=searchparam indexed=true//td /tr /logic:iterate /logic:present And it seems that this results in the following bit of HTML: tr bgcolor=#FF td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td /tr Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I would have thought it would be element[0].searchfield... And what do I need to do in my form bean to create set-methods for this? Meaning: What does Struts expect to find in my form bean if I am using an indexed field as shown above? At the moment, I keep getting an index out of bounds-exception which is quite natural, I think, since there is no array that could be set with something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So I know, I am using these tags wrong. I just can't find out how to use them correctly... Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate and html:text indexed=true/
Of course it works with session-scoped beans; that's what an ActionForn/DynaActionForm is by default. second, id is complete arbitrary - you can call any page object anything you want. Mark -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: logic:iterate and html:text indexed=true/ my small understanding on how to use this is as follows: logic:iterate name=form_name property=property_name id=property_name html:text property=some_property indexed=true ok -- 1. form_name is the name of the form 2. property_name is the name of the property and for some reason the id= also has to have the same name 3. indexed=true indicates that property is coming from what we are iterating over. 4. I have only got this to work with forms. So I don't know if it works for session scoped beans and it means that when you submit it will populate the bean. sandeep --- Nadja Senoucci [EMAIL PROTECTED] wrote: Hello again, I am currently testing around with the above named tags (in order to get around my earlier discribed problem sooner or later) and I don't think I quite understand what happens when you set indexed=true for text fields. I have this little bit of code in my .jsp: logic:present name=cntarr bean:define name=cntarr scope=session id=cntarr type=java.util.Collection/ logic:iterate id=element name=cntarr tr bgcolor=#FF td colspan=2html:text property=searchfield indexed=true//td td colspan=2html:text property=searchparam indexed=true//td /tr /logic:iterate /logic:present And it seems that this results in the following bit of HTML: tr bgcolor=#FF td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td /tr Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I would have thought it would be element[0].searchfield... And what do I need to do in my form bean to create set-methods for this? Meaning: What does Struts expect to find in my form bean if I am using an indexed field as shown above? At the moment, I keep getting an index out of bounds-exception which is quite natural, I think, since there is no array that could be set with something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So I know, I am using these tags wrong. I just can't find out how to use them correctly... Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate and html:text indexed=true/
of course -I'm being stupid about the session scoped beans, however I haven't looked at the code and I don't know how the indexed property works with the iterate tag and I cannot extrapolate at the current moment either about what the code might look like. What I mean to say is: I don't know if indexed=true works for anything other than forms. Should I guess, maybe you know. Are you sure you can name the id anything you want? It didn't seem to work for me until I named it the same as the property for whatever reason. Do you have a working sample? I suppose I should just try it. Also: if you are using the nested:iterate, can you include a jsp and have it used indexed=true I wonder? sandeep --- Mark Galbreath [EMAIL PROTECTED] wrote: Of course it works with session-scoped beans; that's what an ActionForn/DynaActionForm is by default. second, id is complete arbitrary - you can call any page object anything you want. Mark -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: logic:iterate and html:text indexed=true/ my small understanding on how to use this is as follows: logic:iterate name=form_name property=property_name id=property_name html:text property=some_property indexed=true ok -- 1. form_name is the name of the form 2. property_name is the name of the property and for some reason the id= also has to have the same name 3. indexed=true indicates that property is coming from what we are iterating over. 4. I have only got this to work with forms. So I don't know if it works for session scoped beans and it means that when you submit it will populate the bean. sandeep --- Nadja Senoucci [EMAIL PROTECTED] wrote: Hello again, I am currently testing around with the above named tags (in order to get around my earlier discribed problem sooner or later) and I don't think I quite understand what happens when you set indexed=true for text fields. I have this little bit of code in my .jsp: logic:present name=cntarr bean:define name=cntarr scope=session id=cntarr type=java.util.Collection/ logic:iterate id=element name=cntarr tr bgcolor=#FF td colspan=2html:text property=searchfield indexed=true//td td colspan=2html:text property=searchparam indexed=true//td /tr /logic:iterate /logic:present And it seems that this results in the following bit of HTML: tr bgcolor=#FF td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td /tr Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I would have thought it would be element[0].searchfield... And what do I need to do in my form bean to create set-methods for this? Meaning: What does Struts expect to find in my form bean if I am using an indexed field as shown above? At the moment, I keep getting an index out of bounds-exception which is quite natural, I think, since there is no array that could be set with something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So I know, I am using these tags wrong. I just can't find out how to use them correctly... Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate and html:text indexed=true/
There is good example demonstrating this http://www.scioworks.net/devnews/strutsDistilled/updates/update-030401/indexedAttr.html It is not very clear on how to declare an Action Form, so if some body can show an example of how to use ArrayList etc it will be og great help. Thanks [EMAIL PROTECTED] 06/10/03 02:59PM of course -I'm being stupid about the session scoped beans, however I haven't looked at the code and I don't know how the indexed property works with the iterate tag and I cannot extrapolate at the current moment either about what the code might look like. What I mean to say is: I don't know if indexed=true works for anything other than forms. Should I guess, maybe you know. Are you sure you can name the id anything you want? It didn't seem to work for me until I named it the same as the property for whatever reason. Do you have a working sample? I suppose I should just try it. Also: if you are using the nested:iterate, can you include a jsp and have it used indexed=true I wonder? sandeep --- Mark Galbreath [EMAIL PROTECTED] wrote: Of course it works with session-scoped beans; that's what an ActionForn/DynaActionForm is by default. second, id is complete arbitrary - you can call any page object anything you want. Mark -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: logic:iterate and html:text indexed=true/ my small understanding on how to use this is as follows: logic:iterate name=form_name property=property_name id=property_name html:text property=some_property indexed=true ok -- 1. form_name is the name of the form 2. property_name is the name of the property and for some reason the id= also has to have the same name 3. indexed=true indicates that property is coming from what we are iterating over. 4. I have only got this to work with forms. So I don't know if it works for session scoped beans and it means that when you submit it will populate the bean. sandeep --- Nadja Senoucci [EMAIL PROTECTED] wrote: Hello again, I am currently testing around with the above named tags (in order to get around my earlier discribed problem sooner or later) and I don't think I quite understand what happens when you set indexed=true for text fields. I have this little bit of code in my .jsp: logic:present name=cntarr bean:define name=cntarr scope=session id=cntarr type=java.util.Collection/ logic:iterate id=element name=cntarr tr bgcolor=#FF td colspan=2html:text property=searchfield indexed=true//td td colspan=2html:text property=searchparam indexed=true//td /tr /logic:iterate /logic:present And it seems that this results in the following bit of HTML: tr bgcolor=#FF td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td /tr Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I would have thought it would be element[0].searchfield... And what do I need to do in my form bean to create set-methods for this? Meaning: What does Struts expect to find in my form bean if I am using an indexed field as shown above? At the moment, I keep getting an index out of bounds-exception which is quite natural, I think, since there is no array that could be set with something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So I know, I am using these tags wrong. I just can't find out how to use them correctly... Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate and html:text indexed=true/
Hi, While normally the id can be anything you want, in the case of indexing you are correct that it must be the same as the property. The 'index out of bounds' is one of those classic problems with indexed properties since the list that holds the objects must be pre-initialized to hold them. If you search the archive you'll find a variety of solutions, one being using a hidden field and the size of the list to initialize in the reset method. The cooler (dare I say preferred? sure, except I haven't tried it) solution was posted a couple times by Aaron Bates which initializes on the fly. -john -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 11:59 AM To: Struts Users Mailing List Subject: RE: logic:iterate and html:text indexed=true/ of course -I'm being stupid about the session scoped beans, however I haven't looked at the code and I don't know how the indexed property works with the iterate tag and I cannot extrapolate at the current moment either about what the code might look like. What I mean to say is: I don't know if indexed=true works for anything other than forms. Should I guess, maybe you know. Are you sure you can name the id anything you want? It didn't seem to work for me until I named it the same as the property for whatever reason. Do you have a working sample? I suppose I should just try it. Also: if you are using the nested:iterate, can you include a jsp and have it used indexed=true I wonder? sandeep --- Mark Galbreath [EMAIL PROTECTED] wrote: Of course it works with session-scoped beans; that's what an ActionForn/DynaActionForm is by default. second, id is complete arbitrary - you can call any page object anything you want. Mark -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: logic:iterate and html:text indexed=true/ my small understanding on how to use this is as follows: logic:iterate name=form_name property=property_name id=property_name html:text property=some_property indexed=true ok -- 1. form_name is the name of the form 2. property_name is the name of the property and for some reason the id= also has to have the same name 3. indexed=true indicates that property is coming from what we are iterating over. 4. I have only got this to work with forms. So I don't know if it works for session scoped beans and it means that when you submit it will populate the bean. sandeep --- Nadja Senoucci [EMAIL PROTECTED] wrote: Hello again, I am currently testing around with the above named tags (in order to get around my earlier discribed problem sooner or later) and I don't think I quite understand what happens when you set indexed=true for text fields. I have this little bit of code in my .jsp: logic:present name=cntarr bean:define name=cntarr scope=session id=cntarr type=java.util.Collection/ logic:iterate id=element name=cntarr tr bgcolor=#FF td colspan=2html:text property=searchfield indexed=true//td td colspan=2html:text property=searchparam indexed=true//td /tr /logic:iterate /logic:present And it seems that this results in the following bit of HTML: tr bgcolor=#FF td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td /tr Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I would have thought it would be element[0].searchfield... And what do I need to do in my form bean to create set-methods for this? Meaning: What does Struts expect to find in my form bean if I am using an indexed field as shown above? At the moment, I keep getting an index out of bounds-exception which is quite natural, I think, since there is no array that could be set with something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So I know, I am using these tags wrong. I just can't find out how to use them correctly... Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar
RE: logic:iterate and html:text indexed=true/
From the docs: html indexed/ Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as id[34].propertyName. Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. (RT EXPR) I remember using this is some complext multi-page logic a year ago - I'll see if I can find the source. It seems to be, though, that using this attribute would be useless without some additional logic in either a scriptlet % if( id[i].equals(propertyName) {} % or some maifestation of the comparators of the logic tag. Otherwise, you are only going to get the last property in the array. Nevertheless, I do remember that I did not use the construct with the ActionForm, but with a Map from an entity EJB. Mark -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 2:59 PM To: Struts Users Mailing List Subject: RE: logic:iterate and html:text indexed=true/ of course -I'm being stupid about the session scoped beans, however I haven't looked at the code and I don't know how the indexed property works with the iterate tag and I cannot extrapolate at the current moment either about what the code might look like. What I mean to say is: I don't know if indexed=true works for anything other than forms. Should I guess, maybe you know. Are you sure you can name the id anything you want? It didn't seem to work for me until I named it the same as the property for whatever reason. Do you have a working sample? I suppose I should just try it. Also: if you are using the nested:iterate, can you include a jsp and have it used indexed=true I wonder? sandeep --- Mark Galbreath [EMAIL PROTECTED] wrote: Of course it works with session-scoped beans; that's what an ActionForn/DynaActionForm is by default. second, id is complete arbitrary - you can call any page object anything you want. Mark -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: logic:iterate and html:text indexed=true/ my small understanding on how to use this is as follows: logic:iterate name=form_name property=property_name id=property_name html:text property=some_property indexed=true ok -- 1. form_name is the name of the form 2. property_name is the name of the property and for some reason the id= also has to have the same name 3. indexed=true indicates that property is coming from what we are iterating over. 4. I have only got this to work with forms. So I don't know if it works for session scoped beans and it means that when you submit it will populate the bean. sandeep --- Nadja Senoucci [EMAIL PROTECTED] wrote: Hello again, I am currently testing around with the above named tags (in order to get around my earlier discribed problem sooner or later) and I don't think I quite understand what happens when you set indexed=true for text fields. I have this little bit of code in my .jsp: logic:present name=cntarr bean:define name=cntarr scope=session id=cntarr type=java.util.Collection/ logic:iterate id=element name=cntarr tr bgcolor=#FF td colspan=2html:text property=searchfield indexed=true//td td colspan=2html:text property=searchparam indexed=true//td /tr /logic:iterate /logic:present And it seems that this results in the following bit of HTML: tr bgcolor=#FF td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td td colspan=2input type=text name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td /tr Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I would have thought it would be element[0].searchfield... And what do I need to do in my form bean to create set-methods for this? Meaning: What does Struts expect to find in my form bean if I am using an indexed field as shown above? At the moment, I keep getting an index out of bounds-exception which is quite natural, I think, since there is no array that could be set with something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So I know, I am using these tags wrong. I just can't find out how to use them correctly... Greetings, Nadja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail
Re: logic:iterate and html:submit
Try my code and add the following in the bean definition: bean:define id=buttonName name=address property=hash type=java.lang.String / Marco - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, June 09, 2003 2:09 AM Subject: Re: logic:iterate and html:submit Sorry friend, but it doesnt work too. ServletException in:/common/partyCollection.jsp] Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 19 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:128: Incompatible type for method. Explicit cast needed to convert java.lang.Object to java.lang.String. _jspx_th_html_submit_0.setValue(buttonName); ^1 error, 1 warning 'org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 19 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:128: Incompatible type for method. Explicit cast needed to convert java.lang.Object to java.lang.String. _jspx_th_html_submit_0.setValue(buttonName); ^1 error, 1 warning at org.apache.jasper.compiler.Compiler.compile(Compiler.java:289) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at I already tried cast, use bean:write but nothing works... : ( Marco Tedone writes: Try: logic:iterate name=valueObjectproperty=addressesid=address bean:define id=buttonName name=address property=hash / tr td /td td html:submit property=editAddress value='%= buttonName %' title=Alterar/Alterar/html:submit /td /tr /logic:iterate - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 11:51 PM Subject: Re: logic:iterate and html:submit Thanx for your attention... Still not compiling: Actually, the last message error is: [ServletException in:/common/partyCollection.jsp] Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 18 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:104: Method getHash() not found in class java.lang.Object. _jspx_th_html_submit_0.setValue(address.getHash()); ^ 1 error, 1 warning ' org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 18 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:104: Method getHash() not found in class java.lang.Object. _jspx_th_html_submit_0.setValue(address.getHash()); ^ 1 error, 1 warning The jsp is ... %@ taglib uri=/WEB-INF/struts-bean.tldprefix=bean% %@ taglib uri=/WEB-INF/struts-logic.tldprefix=logic% %@ taglib uri=/WEB-INF/struts-html.tldprefix=html% %@ taglib uri=/WEB-INF/sslext.tldprefix=ßslext% %@ taglib uri=/WEB-INF/struts-tiles.tldprefix=tiles% tr td Lista de Enderegos: /td /tr logic:iterate name=valueObjectproperty=addressesid=address tr td /td td html:submit property=editAddress value='%=address.getHash()%' title=Alterar/Alterar/html:submit /td /tr /logic:iterate My real problem is... call an action with two parameters: Action and hash where, hash must be value equal to property hash from bean address. ok ? Marco Tedone writes: So if this is java code, you should use: html:submit property='%= buttonAddress(address.hash).name%' Edit /html:submit Am I wrong? In any case, if it's a name that you need, have you tried bean:message key=foo? Hope it will help, Marco - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:56 PM Subject: Re: logic:iterate and html:submit Marco Tedone writes: - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:34 PM Subject: logic:iterate and html:submit Friendly developers, I am substituting html:link to html:submit, to populate the actionForm before to change the action
Re: logic:iterate and html:submit
Thanx very much... I am using another solution now. Actually, to use bean in value, I should use bean:write within html:submit /html:submit Anyway the button would have rendered the hashCode as label when I would like to have passed this value as argument. Marco Tedone writes: Try my code and add the following in the bean definition: bean:define id=buttonName name=address property=hash type=java.lang.String / Marco - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, June 09, 2003 2:09 AM Subject: Re: logic:iterate and html:submit Sorry friend, but it doesnt work too. ServletException in:/common/partyCollection.jsp] Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 19 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:128: Incompatible type for method. Explicit cast needed to convert java.lang.Object to java.lang.String. _jspx_th_html_submit_0.setValue(buttonName); ^1 error, 1 warning 'org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 19 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:128: Incompatible type for method. Explicit cast needed to convert java.lang.Object to java.lang.String. _jspx_th_html_submit_0.setValue(buttonName); ^1 error, 1 warning at org.apache.jasper.compiler.Compiler.compile(Compiler.java:289) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at I already tried cast, use bean:write but nothing works... : ( Marco Tedone writes: Try: logic:iterate name=valueObjectproperty=addressesid=address bean:define id=buttonName name=address property=hash / tr td /td td html:submit property=editAddress value='%= buttonName %' title=Alterar/Alterar/html:submit /td /tr /logic:iterate - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 11:51 PM Subject: Re: logic:iterate and html:submit Thanx for your attention... Still not compiling: Actually, the last message error is: [ServletException in:/common/partyCollection.jsp] Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 18 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:104: Method getHash() not found in class java.lang.Object. _jspx_th_html_submit_0.setValue(address.getHash()); ^ 1 error, 1 warning ' org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 18 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\par tyCollection$jsp.java:104: Method getHash() not found in class java.lang.Object. _jspx_th_html_submit_0.setValue(address.getHash()); ^ 1 error, 1 warning The jsp is ... %@ taglib uri=/WEB-INF/struts-bean.tldprefix=bean% %@ taglib uri=/WEB-INF/struts-logic.tldprefix=logic% %@ taglib uri=/WEB-INF/struts-html.tldprefix=html% %@ taglib uri=/WEB-INF/sslext.tldprefix=ßslext% %@ taglib uri=/WEB-INF/struts-tiles.tldprefix=tiles% tr td Lista de Enderegos: /td /tr logic:iterate name=valueObjectproperty=addressesid=address tr td /td td html:submit property=editAddress value='%=address.getHash()%' title=Alterar/Alterar/html:submit /td /tr /logic:iterate My real problem is... call an action with two parameters: Action and hash where, hash must be value equal to property hash from bean address. ok ? Marco Tedone writes: So if this is java code, you should use: html:submit property='%= buttonAddress(address.hash).name%' Edit /html:submit Am I wrong? In any case, if it's a name that you need, have you tried bean:message key=foo? Hope it will help, Marco - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:56 PM Subject: Re: logic:iterate
Re: logic:iterate and html:submit
- Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:34 PM Subject: logic:iterate and html:submit Friendly developers, I am substituting html:link to html:submit, to populate the actionForm before to change the action. I would like use html:submit button to edit items of a collection. When I ws using html:link I had specified a property of this item to find its. So... how could I substitute html:link to html:submit ??? I was using ... sslext:link page=/addresses/main.do paramId=hash paramName=address paramProperty=hash bean:write name=addressproperty=streetAddress/ /sslext:link And I am trying using ... html:submit property=buttonAddress(address.hash).nameEdit /html:submit but it doesnt work What does 'buttonAddress(address.hash).name ' represent? It seems to me that this kind of code couldn't be used neither for a javascript nor for a java code. Marco - 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 and html:submit
Marco Tedone writes: - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:34 PM Subject: logic:iterate and html:submit Friendly developers, I am substituting html:link to html:submit, to populate the actionForm before to change the action. I would like use html:submit button to edit items of a collection. When I ws using html:link I had specified a property of this item to find its. So... how could I substitute html:link to html:submit ??? I was using ... sslext:link page=/addresses/main.do paramId=hash paramName=address paramProperty=hash bean:write name=addressproperty=streetAddress/ /sslext:link And I am trying using ... html:submit property=buttonAddress(address.hash).nameEdit /html:submit but it doesnt work What does 'buttonAddress(address.hash).name ' represent? It seems to me that this kind of code couldn't be used neither for a javascript nor for a java code. Marco ok .. I specified getButtonAddress(String hash) that returns an ButtonBean ButtonBean has a method getName... But, if you have other suggestion, I will be very happy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate and html:submit
So if this is java code, you should use: html:submit property='%= buttonAddress(address.hash).name%' Edit /html:submit Am I wrong? In any case, if it's a name that you need, have you tried bean:message key=foo? Hope it will help, Marco - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:56 PM Subject: Re: logic:iterate and html:submit Marco Tedone writes: - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:34 PM Subject: logic:iterate and html:submit Friendly developers, I am substituting html:link to html:submit, to populate the actionForm before to change the action. I would like use html:submit button to edit items of a collection. When I ws using html:link I had specified a property of this item to find its. So... how could I substitute html:link to html:submit ??? I was using ... sslext:link page=/addresses/main.do paramId=hash paramName=address paramProperty=hash bean:write name=addressproperty=streetAddress/ /sslext:link And I am trying using ... html:submit property=buttonAddress(address.hash).nameEdit /html:submit but it doesnt work What does 'buttonAddress(address.hash).name ' represent? It seems to me that this kind of code couldn't be used neither for a javascript nor for a java code. Marco ok .. I specified getButtonAddress(String hash) that returns an ButtonBean ButtonBean has a method getName... But, if you have other suggestion, I will be very happy. - 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 and html:submit
Thanx for your attention... Still not compiling: Actually, the last message error is: [ServletException in:/common/partyCollection.jsp] Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 18 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\partyCollection$jsp.java:104: Method getHash() not found in class java.lang.Object. _jspx_th_html_submit_0.setValue(address.getHash()); ^ 1 error, 1 warning ' org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 18 in the jsp file: /common/partyCollection.jsp Generated servlet error: C:\DOCUME~1\RODRIG~1\CONFIG~1\Temp\Jetty_0_0_0_0_8080__web-client\common\partyCollection$jsp.java:104: Method getHash() not found in class java.lang.Object. _jspx_th_html_submit_0.setValue(address.getHash()); ^ 1 error, 1 warning The jsp is ... %@ taglib uri=/WEB-INF/struts-bean.tldprefix=bean% %@ taglib uri=/WEB-INF/struts-logic.tldprefix=logic% %@ taglib uri=/WEB-INF/struts-html.tldprefix=html% %@ taglib uri=/WEB-INF/sslext.tldprefix=ßslext% %@ taglib uri=/WEB-INF/struts-tiles.tldprefix=tiles% tr td Lista de Enderegos: /td /tr logic:iterate name=valueObjectproperty=addressesid=address tr td /td td html:submit property=editAddress value='%=address.getHash()%' title=Alterar/Alterar/html:submit /td /tr /logic:iterate My real problem is... call an action with two parameters: Action and hash where, hash must be value equal to property hash from bean address. ok ? Marco Tedone writes: So if this is java code, you should use: html:submit property='%= buttonAddress(address.hash).name%' Edit /html:submit Am I wrong? In any case, if it's a name that you need, have you tried bean:message key=foo? Hope it will help, Marco - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:56 PM Subject: Re: logic:iterate and html:submit Marco Tedone writes: - Original Message - From: Rodrigo di Lorenzo Lopes [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, June 08, 2003 10:34 PM Subject: logic:iterate and html:submit Friendly developers, I am substituting html:link to html:submit, to populate the actionForm before to change the action. I would like use html:submit button to edit items of a collection. When I ws using html:link I had specified a property of this item to find its. So... how could I substitute html:link to html:submit ??? I was using ... sslext:link page=/addresses/main.do paramId=hash paramName=address paramProperty=hash bean:write name=addressproperty=streetAddress/ /sslext:link And I am trying using ... html:submit property=buttonAddress(address.hash).nameEdit /html:submit but it doesnt work What does 'buttonAddress(address.hash).name ' represent? It seems to me that this kind of code couldn't be used neither for a javascript nor for a java code. Marco ok .. I specified getButtonAddress(String hash) that returns an ButtonBean ButtonBean has a method getName... But, if you have other suggestion, I will be very happy. - 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] -- Rodrigo di Lorenzo Lopes (Mineirinho) - ICQ 52982003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]