• 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

on logic:iterate tag

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear friends
I have a query regarding bean:iterate tag.According to the rule we should use logic tag like this
<logic:iterate name="aForm" property="aproperty">
do something....
</logic:iterate>

where "aForm" is a Form bean or any bean. and "aproperty" is a property of that bean.
Now can I use <logic:iterate> tag without any use of form bean. Like
I have a list from my action
AnArrayList.add("element1");
AnArrayList.add("element2");
AnArrayList.add("element3");
AnArrayList.add("element4");
(I can use any object instead of String elements).
request.setAttribute("AnArrayList",AnArrayList);
.......
In jsp I am getting the arrayList object
ArrayList AnArrayList=(ArrayList)request.getAttribute("AnArrayList");
Now what code should I write in my jsp using <logic:iterate > in order to get the elements of the ArrayList .
Does the approach change if I use HashMap in stead of ArrayList?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Saptarshi Chakraborty:
Now what code should I write in my jsp using <logic:iterate > in order to get the elements of the ArrayList?


reply
    Bookmark Topic Watch Topic
  • New Topic