velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santosh Puranshettiwar <sant...@wirkle.com>
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 )
$person.name
#if( $person.details )
#set( $hyperLink = ${person.name}details )
#set( $personDetailsMap.put(${person.name}details, $person.details)
<a href="$hyperLink">Details</a>
#end
#end

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

##Person details go here

#end


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

Thanks,
Santosh.

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message