nvelocity - Velocity: How to make a global array? -


i have 3 vm files: f1.vm, f2.vm , f3.vm in f1.vm make array name protocol_versions:

#set($protocol_versions = [])  

i want add elements in protocol_versions f2.vm file:

#set($success = $protocol_versions.add('{"major":1, "minor":0}')) 

and use protocol_versions array in f3.vm

[ #foreach( $protocolversion in protocol_versions ) { "header": {            "upv": $protocolversion,           }, }  #if(!$foreach.last)  ,  #end #end ] 

i tried unfortunately not initialization. possible ?


Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -