• 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

Iterating through Vector

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have vector contains vector, this is code

Vector outsideVector ov = new Vector();

Vector insideVector iv = new Vector();
iv.add("one");
iv.add("two");

ov.add(iv);

iv =new Vector();
iv.add("three");
iv.add("four");

ov.add(iv);

and i m setting outside vector to request object
request.setAttribute("data", ov);

now i want to display value like this

Last Name First Name
one two
Three four


so how can i extract his value in jsp using <logic:iterate> tag

i am stuck here.....please help me
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<logic:iterate name="outsideVector" id="insideVector" type="java.util.Vector" scope="request">
<br>
<logic:iterate name="insideVector" id="element">
<bean:write name="element" />  
</logic:iterate>
</logic:iterate>

This assumes that in the action class, you have the statement:

request.setAttribute("outsideVector", outsideVector);
[ May 03, 2005: Message edited by: Merrill Higginson ]
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic