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
Post a Comment