• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

logic iterate

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am working on my first struts application and am caught up with the listbox. Instead of hard coding the values need to generate it with an vector, i read couple of articles,but never successful.
I defined the vector and added couple of values.
When i defined it in jsp, i got null pointer, not sure why, can someone give me a simple example of logic iterate.I have problem understanding what should go in the name"..." property"...."
The file I have the vector is mainaction.java and the getter and setters are in mainform.java and the jsp is requestpage.jsp.
My requestpage.jsp when submitted goes to mainaction for validation, this is where i am confused.Should my vector be in this file should it be in some file which would be invoked during the load of requestpage.jsp.
Any clarification or example, much appreciated.
Thanks!
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I dont know whether this is helpful for you
In my action class i am getting list of values which i want to display in jsp using iterate tag.
So in my Action class i am setting it as
request.setAttribute("CrmsMergeDuplicateBorrower",borrowerTypeList);
In JSP to display values from this using logic iterator
So there i am giving as
<logic:iterate name="CrmsMergeDuplicateBorrower" id="TableColumn">

<tr>
<td class="BasCellAmount" width="4%" height="20"> </td>
<td class="BasCellAmount" width="50%" height="20">

<bean:write name="TableColumn" property="itemDescription"/>
</td>
<td class="BasCellAmount" width="30%" height="20">
<bean:write name="TableColumn" property="itemValue"/>
<html:hidden name="TableColumn" property="itemCode"/>
</td>
<td class="BasCellAmount" width="2%" height="20"> </td>
</tr>
</logic:iterate>

Here i am not defining property for logi:iterate tag.
for more detailed explanation for logic:iterate please go through jakarta tutorial. Its really helpful
Try this way
I dont know exactly whats your problem is . But hope this will help you
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic