• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

using logic:iterate tag

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my action class i have
ArrayList a1 = new ArrayList();
String s = "first";
a1.add(s);
s= "second";
a1.add(s);
In jsp I need to itterate through this arraylist,
<logic:iterate id="b" name="a1" type=String>
<tr>
<td> <bean:write name="b" property=a1/></td>
</tr>
</logic:iterate>
This does not work.
Can someone suggest me how should I be doing this?
I dont have anything in form bean for this arryalist.
Is it not possible to handle this without putting corresponding attribute in form bean?

Thanks!!
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gemini Moses:
In my action class i have
ArrayList a1 = new ArrayList();
String s = "first";
a1.add(s);
s= "second";
a1.add(s);
In jsp I need to itterate through this arraylist,
<logic:iterate id="b" name="a1" type=String>
<tr>
<td> <bean:write name="b" property=a1/></td>
</tr>
</logic:iterate>
This does not work.
Can someone suggest me how should I be doing this?
I dont have anything in form bean for this arryalist.
Is it not possible to handle this without putting corresponding attribute in form bean?

Thanks!!


at the end in your action class just write

i hope rest of the things will be automatically fine.
 
reply
    Bookmark Topic Watch Topic
  • New Topic