You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by ronsilver <ve...@hawaii.com> on 2002/04/05 10:19:12 UTC

reading several hashtables

 
hi there,
 
Im currently examing velocity with struts and I need help for a specific
problem
 
lets say I create several hashtables,
each of them resides in a single vector element. 
 
 
     Hashtable hash1 = new Hashtable();
     hash1.put("key","value1");
     vector.add(hash1);
        
        Hashtable hash2 = new Hashtable();
        hash2.put("key","value2");
     vector.add(hash2);
        
        Hashtable hash3=new Hashtable();
        hash3.put("key","value3");
     vector.add(hash3);
 
 
I put these lines in an action-form object ( struts ).
 
I have a method to read the complete vector
 
I also have a method to read each hashtable of the vector 
this methods gets the current vector-element-position and returns the
hashtable
 
 
what im looking for is a way to display each element of the hashtable 
in the vm file.
 
To iterate through a single hashtable, vector or array is no problem (
velocity docs )
...
but each vector-element consists of a separate hashtable...
and I need to have access to each key/value pair of tha hashtable
 
hope you got that
 
:o)
 
thanks for help