velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santosh Puranshettiwar <>
Subject Creating HashMaps from within the template for temporary processing
Date Thu, 27 Jul 2006 11:13:04 GMT
Hello everyone,

The situation goes like this.

1. There runs a for loop based on which I need to keep record of a key 
value pair.
2. Based on these key value pairs some more text is added later, outside 
the for loop (in step1).

For example: -
#foreach( $person in $person_list )
#if( $person.details )
#set( $hyperLink = ${}details )
#set( $personDetailsMap.put(${}details, $person.details)
<a href="$hyperLink">Details</a>

#set( $perseonDetailKeyList  = $personDetailsMap.keySet() )
#foreach( $personDetail in $personDetailKeyList )
<a name="person.html#$personDetail">$personDetail</a>

##Person details go here


The only difficulty I am facing here is, how do I instantiate 
$personDetailsMap within the velocity template.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message